[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Here's a interest one: Layout has stopped happening in my app
From:       Scott Palmer <swpalmer () gmail ! com>
Date:       2015-03-29 16:05:56
Message-ID: CAL3e5iEHSVLHq7stvY_TCQYN=tfYrwgNMhsY1xktGzR3KHri=w () mail ! gmail ! com
[Download RAW message or body]

Running 8u40:

I was running a long-term test to reproduce a leak that I reported earlier
with ProgressBarSkin accumulating WeakReferences via some binding related
to Invalidation listeners.  My app has been running for 43 hours.  It is
currently running fine and the memory stats show the heap size has grown to
the max 512MB but actual usage is only 175MB after I force a GC with
jvisualvm.

However logs show that about 20 hours ago this happened:

Exception in thread "JavaFX Application Thread" java.lang.OutOfMemoryError:
Java heap space
        at java.util.Arrays.copyOf(Unknown Source)
        at java.util.ArrayList.grow(Unknown Source)
        at java.util.ArrayList.ensureExplicitCapacity(Unknown Source)
        at java.util.ArrayList.ensureCapacityInternal(Unknown Source)
        at java.util.ArrayList.add(Unknown Source)
        at
com.sun.javafx.scene.control.skin.VirtualFlow$ArrayLinkedList.addLast(Unknown
Source)
        at com.sun.javafx.scene.control.skin.VirtualFlow.addToPile(Unknown
Source)
        at
com.sun.javafx.scene.control.skin.VirtualFlow.addAllToPile(Unknown Source)
        at
com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Parent.layout(Unknown Source)
        at javafx.scene.Scene.doLayoutPass(Unknown Source)
        at javafx.scene.Scene$ScenePulseListener.pulse(Unknown Source)
        at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Unknown Source)
        at com.sun.javafx.tk.Toolkit$$Lambda$115/380219021.run(Unknown
Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.Toolkit.runPulse(Unknown Source)
        at com.sun.javafx.tk.Toolkit.firePulse(Unknown Source)
        at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
        at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
        at
com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$400(Unknown
Source)
        at
com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$49/1241099547.run(Unknown
Source)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)


(That is the ONLY problem logged, none of my own app logic encountered a
problem.)

The result appears to be that JavaFX is stuck thinking a layout is in
progress and refuses to schedule any new ones.  Painting and controls are
working fine, except anything requiring a layout pass isn't happening.

I suspect that perhaps the ProgressBar leak caused this, and that all those
WeakReferences got cleaned up in somewhere in the process, but I can't be
sure.

At this point jvisualvm is throwing ArrayIndexOutOfBoundsException when I
try to open a heap dump, but I was able to save them and load them back
after re-launching jvisualvm.  It isn't clear if ProgressBarSkin is doing
anything weird. After diff'ing heap dumps the bulk of the change in terms
of instance count is in com.sun.javafx.css.PseuoClassState instances and
HashMap related classes.

In any case, I think some protection against an exception (or Error in this
case) disabling all future layout is in order.  I know technically "errors"
aren't supposed to be so recoverable... but my app is still running
perfectly normally with the exception of layout, and it has plenty of free
heap now.

Scott
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic