[PATCH] 8130458 : BooleanBinding binding/unbinding leaks
Vadim Pakhnushev
vadim.pakhnushev at oracle.com
Fri Jul 24 14:15:46 UTC 2015
Hi Jesper,
First of all if you want to contribute to OpenJFX you need to sign OCA,
as described here: http://openjdk.java.net/contribute/
The change itself looks OK, but we might want to look at the other
similar issues, for example, all objects returned from helper class
Bindings will suffer from this.
That is, in the test case from the 8130458 if you change the code in the
loop to Bindings.not(p) the memory will also grow for the same reason.
There is a mechanism for dealing with this kind of issues,
ExpressionHelperBase.trim method, which works with WeakListeners.
So I think it's worth to try to wrap BindingHelperObserver in the
WeakListener in the Binding implementations (BooleanBinding) and see if
it helps.
trim implementation is suboptimal though so if for example a lot of
listeners get collected, then there would be a lot of unnecessary array
copying.
Thanks,
Vadim
On 19.07.2015 11:20, Jesper Skov wrote:
> Hi,
>
> I had a look quick look around in the bugs lists for something to try
> fixing. I happened on this issue.
>
> I am aware that the other primitive binding classes should have similar
> treatment.
> But I wanted to get approval/hints before continuing.
>
> The change adds a new inner class that allows the wrapped binding to be
> unbound when the parent is.
>
> There is no test (hard to test presence/absence of a leak).
>
> Thanks,
> Jesper
More information about the openjfx-dev
mailing list