RFR: 8293444: Creating ScrollPane with same content component causes memory leak [v2]

Florian Kirmaier fkirmaier at openjdk.org
Wed Sep 28 10:20:33 UTC 2022


On Fri, 16 Sep 2022 18:04:07 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Using Weak*Listeners eliminates the memory leak.
>
> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8293444: memory buddy

A small comment about the memory test with [JMemoryBuddy](https://github.com/Sandec/JMemoryBuddy).
Instead of this:

<code>
List<WeakReference> refs = ...
WeakReference a = b;
refs.add(a);
<code>
for (WeakReference<ScrollPane> ref : refs) {
       JMemoryBuddy.checkCollectable(ref);
}

It is more readable this way:

JMemoryBuddy.memoryTest(checker -> {
  <code>
  checker.setAsReferenced(objects);
  checker.assertCollectable(b);
});

-------------

PR: https://git.openjdk.org/jfx/pull/900


More information about the openjfx-dev mailing list