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 204798 - Memory leak in OpenedEditors.visibleEditors2Files
Summary: Memory leak in OpenedEditors.visibleEditors2Files
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2011-11-07 20:10 UTC by Jesse Glick
Modified: 2011-11-10 16:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Reference chain (48.62 KB, image/png)
2011-11-07 20:10 UTC, Jesse Glick
Details
Reference chain for another project, showing possible bug in AnnotationHolder; related? (44.32 KB, image/png)
2011-11-07 20:14 UTC, Jesse Glick
Details
Reference chain for a QuietEditorPane (one of 12 in heap) (71.62 KB, image/png)
2011-11-07 20:20 UTC, Jesse Glick
Details
Reference chain for yet another project (40.09 KB, image/png)
2011-11-07 20:33 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-11-07 20:10:57 UTC
Created attachment 112950 [details]
Reference chain

Dev build. Had been working on various projects, then closed them all (all files closed too). Heap usage was still high, so took a dump and found a number of Project impls still in heap. One of the GC root references went through OpenedEditors. Not sure why the key (JTextComponent) was being held, but seems dangerous to hold the DataObject strongly.
Comment 1 Jesse Glick 2011-11-07 20:14:03 UTC
Created attachment 112951 [details]
Reference chain for another project, showing possible bug in AnnotationHolder; related?
Comment 2 Jesse Glick 2011-11-07 20:18:42 UTC
Can confirm that the JavaDataObject shown was for a source file I had closed at least an hour before, in a project that had also been closed for some time.
Comment 3 Jesse Glick 2011-11-07 20:20:32 UTC
Created attachment 112953 [details]
Reference chain for a QuietEditorPane (one of 12 in heap)

This chain suggests a problem due to having run a graphical diff on the file which was leaked.
Comment 4 Jesse Glick 2011-11-07 20:33:12 UTC
Created attachment 112955 [details]
Reference chain for yet another project
Comment 5 Jan Lahoda 2011-11-07 22:54:23 UTC
The problem in OpenedEditors might be that the event from closing the last editor did not arrive (the map contains at most one mapping), will check. The AnnotationHolder link is much more interesting, will need to check deeper (possibly the AH does not handle diff panes correctly?). The parsing.impl stuff is almost surely a consequence of the OpenedEditors (there are still tasks registered for the closed editor).
Comment 6 Jan Lahoda 2011-11-09 09:29:03 UTC
OpenedEditors:
http://hg.netbeans.org/jet-main/rev/4d254cf6d7f4
AnnotationHolder:
http://hg.netbeans.org/jet-main/rev/bb4dfffdeda7
Comment 7 Quality Engineering 2011-11-09 16:14:47 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/4d254cf6d7f4
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #204798: a PropertyChangeEvent from a JTextComponent may arrive even after the component was removed from the EditorRegistry, need to prevent any work on that component in such a case.
Comment 8 Quality Engineering 2011-11-10 16:00:12 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/bb4dfffdeda7
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #204798: resolving a memory leak in AnnotationHolder, where the holder was kept for files that were opened in the diff pane - using EditorRegistry rather than the EditorCookie.Observable.