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 189880 - Massive leak through LibraryManager
Summary: Massive leak through LibraryManager
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 7.0
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 07:11 UTC by Jan Lahoda
Modified: 2010-08-27 03:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2010-08-26 07:11:42 UTC
[recent build]

There appear to be a massive leak related to per-project libraries. In the heap dump, there are >1000000 instances of Library, WeakReference and related classes. There are also more than 100000 instances of LibraryManager. The problem IMO is that: LibraryManagers are being constructed when needed (e.g. by LibraryManager.getOpenManagers()), but not cached. Each library manager non-weakly listens on a LibraryProvider and it also holds the LibraryProvider instance. But the LibraryProviders are weakly-cached at their creation. So one LibraryManager that is being held (e.g. by a query result which is listening on it) holds the LibraryProvider and through the listeners all LibraryManagers that were created for the same LibraryProvider, which is causing the leak.

I am going to change the LibraryManager to listen only weakly on the LibraryProvider.
Comment 1 Jan Lahoda 2010-08-26 07:39:01 UTC
http://hg.netbeans.org/jet-main/rev/44968f0c0f27
Comment 2 Quality Engineering 2010-08-27 03:16:50 UTC
Integrated into 'main-golden', will be available in build *201008270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/44968f0c0f27
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #189880: LibraryManager listens only weakly on the LibraryProvider to prevent leaks.