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

Andy Goryachev angorya at openjdk.org
Wed Sep 28 21:57:27 UTC 2022


On Wed, 28 Sep 2022 20:24:47 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:

>> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8293444: review comments
>
> if you use `checker.setAsReferenced(object)` then the specified object won't be collected for the current test.
> And there is also the statement assertNotCollectable() to check the reverse.
> 
> 
> The method "checkCollectable/assertCollectable" is very slow in the negative case (but reliable in the positive case)
> The method "checkNotCollectable/<assertNotCollectable" should be used, if it's expected that the object is not collectable - otherwise the test will be quite slow.

@FlorianKirmaier :
I am not sure if using JMemoryBuddy.memoryTest results in a clearer or more concise code, given the nature of testScrollPaneObjLeakWhenUsedSameContent().

BTW, MemoryTestAPI names are a bit confusing: "assert*Collectable" suggests assertion is done at the point when these calls are made, though it looks like they just add a reference the an internal list.  Also, assertCollectable might want to skip creation of a WeakReference if the object passed to it is already a WeakReference.

With your permission, I would like to keep this test as is.

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

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


More information about the openjfx-dev mailing list