-
Bug
-
Resolution: Fixed
-
P3
-
7u6
-
Windows 7 64-bit
Java 7u7 32-bit
JavaFX 2.2.0-b21
The Canvas added in JavaFX 2.2 allows developers to paint their own images. This was something needed to implement rendering of generated content. However, due to a design flaw in the implementation it is generally unsable. A Canvas that is not showing on the screen will buffer commands indefinitely until the VM runs out of memory. Something as simple as a user switching to another tab or scrolling the Canvas out of view in a ScrollPane will lead to out of memory errors. It is unreasonable to put the burden of managing this on the application developer since there are so many ways that the Canvas might become "off screen". Also the application requirements in general may make it very difficult to suspend painting to the Canvas, since ultimately all subsequent drawing would need to assume that previous drawing has completed. This basically means that unless the commands are flushed to the Canvas regardless of if it is visible, somebody would have to do the buffering.
Canvas simply must not buffer indefinitely, it needs to flush if some threshold is reached without the Canvas being visible.
Test case attached.
Canvas simply must not buffer indefinitely, it needs to flush if some threshold is reached without the Canvas being visible.
Test case attached.
- duplicates
-
JDK-8116176 Memory leak on Windows screen lock
- Closed
-
JDK-8094438 OutOfMemory error due to GrowableDataBuffer in Canvas when window is not shown
- Closed
- relates to
-
JDK-8093972 OutOfMemoryError after pressing Ctrl+Alt+Del or screen lock while animating a canvas
- Resolved
-
JDK-8296364 Canvas release resources programatically
- Open