This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256880 - Memory issue with lookup
Summary: Memory issue with lookup
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-30 23:35 UTC by tdanard
Modified: 2017-02-15 15:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample NetBeans Platform Application (20.26 KB, application/x-zip-compressed)
2015-11-30 23:35 UTC, tdanard
Details
Trail of references in JProfiler (60.71 KB, image/png)
2015-11-30 23:39 UTC, tdanard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tdanard 2015-11-30 23:35:18 UTC
Created attachment 157570 [details]
Sample NetBeans Platform Application

When I upgraded from NetBeans 7.3.1 from NetBeans 8.0.2, I encountered an issue where the lookup system keeps references to obsolete lookup instances, leading to countless memory leaks.

This is regression as lookups were properly cleaned up with NetBeans 7.3.1. This issue is present with 8.0.2 and 8.1. I didn't test it with other versions.

I have attached a sample NetBeans Platform Application module suite that reproduces this issue. You can run it both with NetBeans 7.3.1 and NetBeans 8.0.2. I have also attached the trail of references preventing a proper garbage collection that JProfiler reports.

To use this sample project, start the application. Click the "Create Window" button in the toolbar then click the "Selection Action" in the toolbar. Close the window. Run a profiler and look for a "MutableLookup" instance. With 7.3.1, the MutableLookup instance is garbage collected. With 8.0.2, it is not.

This issue is critical for me as it prevents me from upgrading to recent versions of NetBeans. I tried to look into the lookup code, but couldn't find the root cause or a workaround.
Comment 1 tdanard 2015-11-30 23:39:26 UTC
Created attachment 157571 [details]
Trail of references in JProfiler
Comment 2 Tomas Hurka 2017-02-15 15:51:00 UTC
I tested your project with NetBeans 8.2 and with setting to Xmx24M. "MutableLookup" instance are collected after some time.