RFR: 8244297: memory leak test utility [v6]
Kevin Rushforth
kcr at openjdk.java.net
Sat Oct 17 13:13:08 UTC 2020
On Fri, 16 Oct 2020 14:08:53 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:
>> modules/javafx.base/src/test/java/test/util/memory/JMemoryBuddy.java line 84:
>>
>>> 82:
>>> 83: /**
>>> 84: * Checks whether the content of the WeakReference can be collected.
>>
>> -> Checks whether the content of the WeakReference **is** collected.
>
> That's not true. At the moment of method-call, the variable might not be collected.
> It doesen't check whether it's collected, it checks whether it is "collectable".
Agreed that "can be collected" is technically more accurate (meaning that "collectable" is a reasonable choice for the
name). Once an object is weakly reachable all `WeakReference`s are cleared and the object can be finalized. The actual
finalization might happen later.
-------------
PR: https://git.openjdk.java.net/jfx/pull/204
More information about the openjfx-dev
mailing list