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 43471 - [refactoring] [perf] Memory leak with each file opened and closed in the editor
Summary: [refactoring] [perf] Memory leak with each file opened and closed in the editor
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-05-18 18:07 UTC by Antonin Nebuzelsky
Modified: 2007-11-05 13:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Reference graph of one NbEditorDocument instance exported from OptimizeIt. (5.72 KB, text/html)
2004-05-18 18:08 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-05-18 18:07:10 UTC
Refactoring build 040517-2nd.

There is a memory leak when files opened in the
editor are closed. I see in profiler that
instances of o.n.m.editor.NbEditorDocument are
kept in memory. For jEdit class's document the
size of the leak (retained size of
NbEditorDocument as reported by profiler) is
~700KB. The leak is perhaps even bigger, including
all the other objects bound to NbEditorDocument.

The possible root (or one of the roots) of the
leak is in a static hashmap of
o.n.m.editor.java.JMIUtils. Profiler shows this
reference graph:

NbEditorDocument
^- doc of JMIUtils
   ^- referent of SoftReference
      ^- value of HashMap$Entry
         ^- element of Object[]
            ^- table of HashMap
               ^- static variable of JMIUtils

There are also references via

^- doc of LineRootElement
   ^- root of LineElement
      ^- next of LineElement
         ^- next of LineElement
            ^- ...

but these cannot be easily tracked down, as the
length of the reference line is very long. These
may not lead to a GC root.
Comment 1 Antonin Nebuzelsky 2004-05-18 18:08:34 UTC
Created attachment 14949 [details]
Reference graph of one NbEditorDocument instance exported from OptimizeIt.
Comment 2 Pavel Flaska 2004-05-18 18:50:08 UTC
Reassigned to editor. As far as I know Mila works on this memory leak
already.
Comment 3 Martin Roskanin 2004-06-18 09:00:25 UTC
should be fixed my Mila's commit:
http://editor.netbeans.org/source/browse/editor/src/org/netbeans/modules/editor/java/JMIUtils.java.diff?r1=1.1.2.14&r2=1.1.2.15
SoftReferences were removed from JMIUtils...
Please, verify. Thanks.
Comment 4 Antonin Nebuzelsky 2004-06-22 14:48:54 UTC
Verified. The NbEditorDocument leak is gone.