out of memory

Tom Eugelink tbee at tbee.org
Sun Nov 18 12:29:28 PST 2012


I'm revisiting the memory issue. If I unfold the whole graph to CG there is no MigPane involved, all I see is dirtyNodes in the Scene class and oldScene in the Node and Window class. So somehow the test combined with MigPane causes JavaFX to keep references. This is a complex situation.

Class Name | Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------------------------------------------------------
|              |
javafx.scene.control.Button @ 0x319c7b30 |          408 |         1,672
'- [60668] javafx.scene.Node[98113] @ 0x29cc8810 |      392,464 |       392,464
    '- dirtyNodes javafx.scene.Scene @ 0x27f65d00 |          376 |       396,728
       |- this$0 javafx.scene.Scene$ScenePeerListener @ 0x28003d60 |           16 |            16
       |  '- sceneListener com.sun.javafx.tk.quantum.ViewScene @ 0x27ffb710 |           64 |           168
       |     |- scene com.sun.javafx.tk.quantum.PrismPen @ 0x27ffc7f0 |           48 |         2,344
       |     |  '- pen com.sun.glass.ui.win.WinView @ 0x27ff4e98 Native Stack |           72 |           480
       |     |- scene com.sun.javafx.tk.quantum.GlassViewEventHandler @ 0x27ffc820                                     |           48 |           408
       |     |- scene com.sun.javafx.tk.quantum.WindowStage @ 0x27f694e8 |           88 |           184
       |     |- [0] java.lang.Object[10] @ 0x27f32398 |           56 |            56
       |     |  '- elementData java.util.ArrayList @ 0x27f02ca0 |           24 |            80
       |     |     '- syncScenes com.sun.javafx.tk.quantum.PaintCollector @ 0x27ee0ae0                                 |           64 |           656
       |     '- Total: 4 entries |              |
       |- oldScene, value javafx.scene.Node$4 @ 0x31121ca8 |           48 |            48
       |  '- scene org.tbee.javafx.scene.layout.test.MigPaneTest11$ListElement @ 0x3111dac0                            |          432 | 4,680
       |     '- [0] java.lang.Object[10] @ 0x27f38dc0 |           56 |            56
       |        '- elementData java.util.ArrayList @ 0x27f06870 |           24 |            80
       |           '- backingList com.sun.javafx.collections.ObservableListWrapper @ 0x27ee38b8                        |           32 |           400
       |              '- items org.tbee.javafx.scene.layout.test.MigPaneTest11 @ 0x27ee0300                            |           16 |            16
       |                 |- <Java Local> java.lang.Thread @ 0x27ee0518  JavaFX-Launcher Thread                         |          112 |           408
       |                 |- this$0 org.tbee.javafx.scene.layout.test.MigPaneTest11$1 @ 0x27f6d558                      |           16 |            16
       |                 |  '- this$1 org.tbee.javafx.scene.layout.test.MigPaneTest11$1$1 @ 0x283116e0  Thread-6 Thread|          112 |           200
       |                 '- Total: 2 entries |              |
       |- oldScene, value javafx.stage.Window$SceneModel @ 0x27f6a640 |           48 |            48
       |  '- scene javafx.stage.Stage @ 0x27f65ea8 |          144 |           992
       |     '- [0] java.lang.Object[10] @ 0x27f6e2b0 |           56 |            56
       |        '- elementData java.util.ArrayList @ 0x27f6bcd8 |           24 |            80
       |           '- backingList com.sun.javafx.collections.ObservableListWrapper @ 0x27f68690                        |           32 |           112
       |              '- stages class javafx.stage.Stage @ 0x32ae1aa0 |           16 |           128
       |                 '- [229] java.lang.Object[2560] @ 0x28341f50 |       10,256 |    29,389,400
       |                    '- elementData java.util.Vector @ 0x27f02268 |           24 |    29,389,424
       |                       '- classes sun.misc.Launcher$AppClassLoader @ 0x27ee0090 Native Stack                   |           72 |    29,414,968
       '- Total: 3 entries |              |
-----------------------------------------------------------------------------------------------------------------------------------------------------

What is special in this test case (aside from the usage of MigPane) is that there is an instance level ObservableList which is registered as the items on ListView. On every iteration this list gets cleared and new nodes are added. If I replace the instance list with a local one, so instead of a clear I set new list in items on ListView, the problem is gone.

So I have a workaround for this case, but I suspect scenario like this: list of items gets cleared, ListView reacts and somehow triggers a relayout, MigPane makes a change to the node, the node gets added to the dirty list (which is not weak BTW) in scene, and the node never gets removed.

What confuses me is that the node is not part of dirtyNodesA or dirtyNodesB. I see that on each pulse the dirtyNodes are cleared. But the memory dumps says otherwise. This will take a lot more effort to uncover, but the dump indicates that the problem must be somewhere in the ListView / Scene combination.
Tom



On 2012-11-06 21:31, Tom Eugelink wrote:
> Yes they are.
>
> I wish I could, but as soon as I drop MigPane and use FlowPane, the issue is gone. But I'm still not seeing a MigPane reference in the path to GC.
>
> Tom
>
>
> On 2012-11-06 20:04, Kevin Rushforth wrote:
>> Are frames being rendered during this time? If so, then you may have discovered a bug. If you have a test case you could file JIRA and attach it.
>>
>> -- Kevin
>



More information about the openjfx-dev mailing list