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.
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.
Created attachment 14949 [details] Reference graph of one NbEditorDocument instance exported from OptimizeIt.
Reassigned to editor. As far as I know Mila works on this memory leak already.
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.
Verified. The NbEditorDocument leak is gone.