<Swing Dev> [10] RFR JDK-8175968: The javax.swing.filechooser.FileSystemView constructor consumes memory by adding a PropertyChangeListener that is never removed.

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Jul 6 13:15:26 UTC 2017


Hi Sergey,

I tried with the proposed WeakPropertyChangeListener but as far I 
understand & tested, it seems also to rely on propertyChange() API to be 
called, so the scenario mentioned in the bug will still fail.
I cannot find any other way rather than calling dispose() for the 
scenario mentioned there.

Regards
Prasanta
On 7/5/2017 4:35 AM, Sergey Bylokhov wrote:
> Hi, Prasanta.
> Probably it is possible to implement it without users interaction and new api?
>
> ----- prasanta.sadhukhan at oracle.com wrote:
>
>> Hi All,
>>
>> Please review a fix for a memory leak issue where
>> PropertyChangeListener
>> object added by FileSystemView constructor is never removed.
>> Proposed fix is to add dispose() method to be called by app when they
>>
>> want to remove this resource.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8175968
>> webrev: http://cr.openjdk.java.net/~psadhukhan/8175968/webrev.00/
>>
>> Regards
>> Prasanta




More information about the swing-dev mailing list