I say 'leaks' because the leak isn't permanent. Amount of heap used will increase up the max allowed, but when it gets there, gc's will free up enough memory to allow the sample to continue running.
To reproduce, do this:
- start FlyingLetters
- start jconsole and connect to FlyingLetters
- click on the memory tab in jconsole
- observe the used and committed values
- click on a flying letter. Note the used value goes up
- click again, etc. Note that the used value goes up with each run
- now click the Perform GC button. The used value goes down
- click the Perform GC button a 2nd time. The used value goes down more
- sometimes, the used value will go down even more with a 3rd click
I commented out the body of the onlayout function and the bug still occurred.
VisualVM can be used to see which classes are involved in this. It appears to me that java.awt.geom.AffineTransform has the most instances.
I'm not sure that this is actually a bug in the JavaFX runtime - it could be a bug in the sample code itself.
To reproduce, do this:
- start FlyingLetters
- start jconsole and connect to FlyingLetters
- click on the memory tab in jconsole
- observe the used and committed values
- click on a flying letter. Note the used value goes up
- click again, etc. Note that the used value goes up with each run
- now click the Perform GC button. The used value goes down
- click the Perform GC button a 2nd time. The used value goes down more
- sometimes, the used value will go down even more with a 3rd click
I commented out the body of the onlayout function and the bug still occurred.
VisualVM can be used to see which classes are involved in this. It appears to me that java.awt.geom.AffineTransform has the most instances.
I'm not sure that this is actually a bug in the JavaFX runtime - it could be a bug in the sample code itself.