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 59911

Summary: Leaking WeakEventListenerList
Product: editor Reporter: _ rkubacki <rkubacki>
Component: -- Other --Assignee: issues@editor <issues>
Status: RESOLVED WONTFIX    
Severity: blocker CC: issues
Priority: P3 Keywords: PERFORMANCE
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description _ rkubacki 2005-06-13 17:26:22 UTC
There is a special version of EventListenerList in editor holding weak
references to listeners that consumes too much memory and retains unneeded
WeakReference objects. 

Changes from editor settings are fired pretty rarely so all the settings
listeners are kept for a long time. Usualy the are leaking - users usualy do not
modify the settings too often. I have a core dump where >700 weak references to
listeners are held in this array and most of these are already empty. Close and
reopen file adds 10 listeners. 

Another waste of memory is storing of class names - all three usages do no need
to store different listeners in this list.
Comment 1 Miloslav Metelka 2005-11-07 12:04:15 UTC
IIRC only the empty references should be held in the array (together with class
refs) once the listeners are GCed. Although this is IMHO not a serious leak we
plan to deprecate the Settings and use MimeLookup instead which should eliminate
the problem. We will also no longer use EventListenerList and use WeakListeners
instead.
Marking TM to future.
Comment 2 Miloslav Metelka 2008-11-12 10:26:47 UTC
IMHO this is now not serious since the WeakListenerList is only used actively in CustomizableSideBar and Registry (now
replaced by EditorRegistry) so this is a low priority problem.
Comment 3 Quality Engineering 2009-11-02 10:55:37 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX