-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: jfx16
-
Component/s: javafx
-
None
When a stage is not showing, some internal referendes are causing memoryleaks. I've isolated 2 of main problems.
* Scene.dirtyNodes collects nodes - if removed afterwards they stay referenced forever.
* Parent.removed keeps nodes which are removes. Presumable to calculate whether the rendering of the Parent is dirty.
This is of course very bad, and can cause big memory leaks, dependent of the application.
I've seen it regular in combination with Toolbar, but also in other contexts.
In the application where I've found the issue, it kept a big part of the heap.
The dirtyNodes part can be "fixed" by making the nodes Weak, but i don't think it's correct, and leaves the Parent.removed issue open.
Changing the logic for Parent.removed probably causes rendering bugs. The removed nodes are used to calculate whether the node is dirty. So changing this isn't a real solution.
The solution which comes into my mind, is to process the dirtyNodes, even if the stage isn't showing.
To do so, it would probably be necessary, to request synchronizeSceneNodes in Scene wheb a dirty node is added.
Maybe as a kind of "simplified scene pulse"?
Any suggestions about this?
I'm not so familiar with this part of the code.
I would be happy to hear some ideas about this.
A unit test can be found in the issue.
* Scene.dirtyNodes collects nodes - if removed afterwards they stay referenced forever.
* Parent.removed keeps nodes which are removes. Presumable to calculate whether the rendering of the Parent is dirty.
This is of course very bad, and can cause big memory leaks, dependent of the application.
I've seen it regular in combination with Toolbar, but also in other contexts.
In the application where I've found the issue, it kept a big part of the heap.
The dirtyNodes part can be "fixed" by making the nodes Weak, but i don't think it's correct, and leaves the Parent.removed issue open.
Changing the logic for Parent.removed probably causes rendering bugs. The removed nodes are used to calculate whether the node is dirty. So changing this isn't a real solution.
The solution which comes into my mind, is to process the dirtyNodes, even if the stage isn't showing.
To do so, it would probably be necessary, to request synchronizeSceneNodes in Scene wheb a dirty node is added.
Maybe as a kind of "simplified scene pulse"?
Any suggestions about this?
I'm not so familiar with this part of the code.
I would be happy to hear some ideas about this.
A unit test can be found in the issue.
- relates to
-
JDK-8092779 Memory leak when Hiding Stage with background visual updates
-
- Closed
-
- links to
-
Review
openjdk/jfx/584