On Fri, 13 Jan 2023 12:35:12 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

> Option 1 breaks the second example and leads to new problems; those new 
> problems are even harder to debug than a simple memory leak, as all the 
> elaborate tests all over the JavaFX code base that rely on System.gc() 
> clearly show.

I've written a library (https://github.com/Sandec/JMemoryBuddy) and integrated 
to the JFX projects, to make these tests reliable and understandable. Imo all 
tests using System.gc() directly should be refactored, because without some 
tricks it's not really deterministic.

WeakReferences is a highly discussed topic.
Lazy evaluation is also not without problems.
I personally feel confident with using WeakReferences, especially after 
ensuring it's behavior with unit test.

@hjohn made an own version of this PR, with this version my tests are included 
and green, so im fine with it too.
[Link to PR](https://github.com/openjdk/jfx/pull/1004)

It's important that normal Properties and CollectionProperties behave somehow 
similar.
Thats why this (or hjohn) PR is important.

This Version just fixes the bug, and ensures it behaves the same as other 
properties.

In the end someone has to decide which version is better.
But it would be great if one of them would move forward.
In the end someone has to decide which PR is moved forward.

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

PR Comment: https://git.openjdk.org/jfx/pull/689#issuecomment-2151816660

Reply via email to