RFR: 8277848 Binding and Unbinding to List leads to memory leak [v4]

Michael Strauß mstrauss at openjdk.org
Wed Jun 22 12:50:11 UTC 2022


On Wed, 22 Jun 2022 10:23:06 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> This is basically another case where it is better to only listen (or bind) to other targets when absolutely necessary (when the source itself is being observed) and to remove the listener (or binding) when no longer observed, basically lazy versus eager observation. Lazy observation would completely remove the need for using weak references, simplifying the logic and making the whole system much easier to reason about.

While I agree that lazy observation would be a good improvement, it just shifts the problem one indirection away. You could still have an entire object graph that is needlessly kept alive by the property wrapper, which is a problem.

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

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


More information about the openjfx-dev mailing list