RFR: 8269907 memory leak - Dirty Nodes / Parent removed [v3]
Florian Kirmaier
fkirmaier at openjdk.java.net
Tue Nov 2 10:27:11 UTC 2021
On Tue, 2 Nov 2021 10:15:41 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:
>> After thinking about this issue for some time, I've now got a solution.
>> I know put the scene in the state it is, before is was shown, when the dirtyNodes are unset, the whole scene is basically considered dirty.
>> This has the drawback of rerendering, whenever a window is "reshown", but it restores sanity about memory behaviour, which should be considered more important.
>
> Florian Kirmaier has updated the pull request incrementally with one additional commit since the last revision:
>
> JDK-8269907
> We now require the rendering lock when cleaning up dirty nodes. To do so, we moved some code required for snapshot into a reusable method.
Thank you for your feedback!
To solidify my understanding - the "RenderScenegraph" is only allowed to be changed when the render lock is held. This scene graph is represented by all these NG<Something> classes, correct?
I've now updated my PR. I found some code for snapshot, which solves the same problem about aquiring the render lock. I've moved it into an own method and used it for my fix.
The regular sync, and the new sync shouldn't happen in the same pulse - because the regular sync checks whether the Window is closed by `if (peer != null)`. At least it shouldn't require the lock. If it would for some reason aquire the lock, then it should basically be a noop - so i don't really see why this would be an issue. Performance wise aquiring an additional lock can cause a very minor slowdown, but because it only happens once per closed window, it is realy minor.
-------------
PR: https://git.openjdk.java.net/jfx/pull/584
More information about the openjfx-dev
mailing list