RFR: 8277848 Binding and Unbinding to List leads to memory leak [v5]
Florian Kirmaier
fkirmaier at openjdk.org
Thu Jul 14 10:23:11 UTC 2022
On Tue, 12 Jul 2022 14:44:03 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Florian Kirmaier has updated the pull request incrementally with one additional commit since the last revision:
>>
>> JDK-8277848
>> Added 3 more tests to verify that a bug discussed in the PR does not appear.
>
> This will require careful review and testing to make sure that we don't introduce any cases where the binding disappears too soon. The main thing we need to be careful about is that we don't take any cases that work reliably today (albeit at the cost of a memory leak) and make them subject to premature garbage collection. I also agree that it seems out of scope to introduce laziness into this existing API. Changing the implementation to use lazy bindings under-the-covers would be acceptable, but only if it caused no app-visible change in behavior.
@kevinrushforth
Yes, premature collection is quite a problem with weak binding, but luckily this can also be checked with unit tests.
So I've added a unit test to verify, that the binding doesn't get collected prematurely.
What we can't test, is whether some applications (or the internal JavaFX code) rely on the memory leak itself. But I guess that is how one can argue with any bug.
-------------
PR: https://git.openjdk.org/jfx/pull/689
More information about the openjfx-dev
mailing list