On Wed, 28 Sep 2022 20:24:47 GMT, Florian Kirmaier <fkirma...@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