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 16072 - Memory leak: Dangling (editor) TopComponents
Summary: Memory leak: Dangling (editor) TopComponents
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2001-10-01 15:23 UTC by Svata Dedic
Modified: 2008-12-22 19:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
gif of the chain (169.64 KB, image/gif)
2001-10-25 13:34 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2001-10-01 15:23:36 UTC
I've worked with NetBeans for a small while. I've opened two java sources in the
editor (they docked into the same frame), closed them (X icon on frame's title),
then opened another file and closed it. I've checked all available workspaces,
none of them held Editor mode visible.
The Editor UI components are, however, still strongly reachable from the
rootset. Dump from HAT follows:

--> sun.awt.motif.MToolkit@0xe8d23808 (48 bytes) (field eventListener:)
 --> java.awt.Toolkit$ToolkitEventMulticaster@0x90d22409 (16 bytes) (field a:)
 --> java.awt.Toolkit$ToolkitEventMulticaster@0x402a9008 (16 bytes) (field a:)
 --> java.awt.Toolkit$ToolkitEventMulticaster@0x70c8ec09 (16 bytes) (field b:)
 --> java.awt.Toolkit$SelectiveAWTEventListener@0x80b4c008 (32 bytes) (field
listener:)
 --> org.netbeans.core.windows.frames.SplitContainerImpl@0x28b20209 (440 bytes)
(field tcs2Weights:)
 --> java.util.HashMap@0xa8940209 (48 bytes) (field table:)
 --> Instance of [Ljava.util.HashMap$Entry;@0x90940209 (60 bytes) (Element 12 of
Instance of [Ljava.util.HashMap$Entry;:)
 --> java.util.HashMap$Entry@0x90b42409 (24 bytes) (field key:)
 --> org.netbeans.modules.java.JavaEditor$JavaEditorComponent@0xd0de6709 (408
bytes) (field obj:)
 --> org.netbeans.modules.java.JavaDataObject@0xc0732209 (104 bytes) (field
parserGlue:)
 --> org.netbeans.modules.java.JavaParserGlue@0x984b2308 (64 bytes) (field
swingElementMap:)
 --> java.util.WeakHashMap@0xd0931109 (32 bytes) (field hash:)
 --> java.util.HashMap@0xc8921109 (48 bytes) (field table:)
 --> Instance of [Ljava.util.HashMap$Entry;@0x80921109 (300 bytes) (Element 22
of Instance of [Ljava.util.HashMap$Entry;:)
 --> java.util.HashMap$Entry@0x58661109 (24 bytes) (field value:)
 --> org.netbeans.modules.java.JavaParserGlue$TextElement@0xf0671109 (24 bytes)
(field myElement:)
 --> org.openide.src.ClassElement@0x4096c250 (24 bytes) (field impl2:)
 --> org.netbeans.modules.java.model.ClassElementImpl@0xb095c250 (104 bytes)
Comment 1 David Simonek 2001-10-02 14:12:05 UTC
Raising priority, important.
Comment 2 David Simonek 2001-10-04 09:32:59 UTC
Reassigned to Ales, famous memory leak hunter :-)
Comment 3 anovak 2001-10-04 13:13:05 UTC
I confirm this issue. There is yet another root set reference:

--> sun.awt.motif.MToolkit@0x0060c1b0 (48 bytes)  (field eventListener:)
--> java.awt.Toolkit$ToolkitEventMulticaster@0x016d5f58 (16 bytes)
(field b:)
--> java.awt.Toolkit$SelectiveAWTEventListener@0x016c84c0 (32 bytes)
(field listener:)
--> org.netbeans.core.windows.frames.SplitContainerImpl@0x016b3410
(440 bytes) (field contentPane:)
--> org.netbeans.core.windows.frames.PerimeterPane@0x016b3858 (336
bytes) (field components:)
--> java.util.HashMap@0x016b3cb8 (48 bytes) (field table:)
--> Instance of [Ljava.util.HashMap$Entry;@0x016b3cf8 (20 bytes)
(Element 4 of Instance of [Ljava.util.HashMap$Entry;:)
--> java.util.HashMap$Entry@0x016c0628 (24 bytes) (field value:)
-->
org.netbeans.modules.java.JavaEditor$JavaEditorComponent@0x012c6ac8
(408 bytes)
Comment 4 anovak 2001-10-05 11:36:56 UTC
And this is another:

--> org.netbeans.core.windows.RegistryImpl@0x00b12060 (40 bytes) 
(field support:)
--> java.beans.PropertyChangeSupport@0x00b12080 (24 bytes) (field
listeners:)
--> java.util.Vector@0x014ad638 (24 bytes) (field elementData:)
--> Instance of [Ljava.lang.Object;@0x01350578 (320 bytes) (Element 51
of Instance of [Ljava.lang.Object;:)
-->
org.netbeans.modules.editor.NbEditorUI$SystemActionUpdater@0x00f09850
(40 bytes) (field this$0:)
--> org.netbeans.modules.editor.NbEditorUI@0x00f10ac0 (208 bytes)
(field glyphGutter:)
--> org.netbeans.editor.GlyphGutter@0x029ea650 (392 bytes) (field doc:)
--> org.netbeans.modules.editor.NbEditorDocument@0x01eea320 (176 bytes)
Comment 5 anovak 2001-10-05 12:00:26 UTC
Window system's issues fixed and committed.
Passing to editor to fix the last dump
Comment 6 David Konecny 2001-10-09 15:00:53 UTC
Svata,

I'm working on editor part of the problem. Could you or somebody from 
your team fix the reference from 
org.netbeans.modules.java.JavaEditor$JavaEditorComponent? 

Thanx,
David
Comment 7 David Konecny 2001-10-10 14:29:03 UTC
Editor part of the problem was just fixed as issue 16427. Moving to 
the java module where the last reference is hold.
Comment 8 Svata Dedic 2001-10-10 14:32:34 UTC
JavaEditorComponent is *the* dangling TopComponent - I don't see
references to ther TopComps down the chain
Comment 9 Svata Dedic 2001-10-24 12:07:52 UTC
No further reference chains. I assume the bug is fixed.
Comment 10 David Konecny 2001-10-25 13:31:40 UTC
Svata,
I just updated all my source and built them and tried it with 
OptimizedIt and I still can see there some references. Am I doing 
something wrong?

I started build wiht clean userdir. Then I removed almost all modules 
apart from:
 Editor [org.netbeans.modules.editor/1 1.8 ${buildnumber}]
 IDE Core [org.netbeans.core/1 1.1]
 Java Source Files [org.netbeans.modules.java/1 1.7 200110250937]
 Javadoc [org.netbeans.modules.javadoc/1 1.7 200110250937]
 Projects [org.netbeans.modules.projects/1 1.7 200110250937]
 Sourceless Java Classes [org.netbeans.modules.clazz/1 1.8 
200110250937]
(othwerwise I had problems with OptimizeIt) and I restarted the IDE 
with OptimizeIt. Then I keep opening/closing three java files and the 
result is after 10-15 opening that 4 references are still hold. They 
look very similar and I will attach screenshot of one of them to 
this issue. It does not look like problem in Java module, but rather 
in Window system. Reassign if necessary. Thanx, David
Comment 11 David Konecny 2001-10-25 13:34:26 UTC
Created attachment 3141 [details]
gif of the chain
Comment 12 Svata Dedic 2001-10-25 13:40:52 UTC
Reassigning to Dafe -- the reference comes from window system. I'll
try to get more info from HAT today (BTW it happened in MDI mode, I've
tested it in SDI last week).
Comment 13 _ ttran 2001-10-29 08:26:52 UTC
Petr, please fix this bug.  You know how to use OptimizeIt :-)
Comment 14 Petr Hrebejk 2001-11-01 14:33:23 UTC
I investigated this bug and I think guys are right it is fixed now. I 
tested  it using OptimizeIt, Hat and printlns in constructor and
finalize() methods of the objects. The conclusion is that you can't
allways trust OptimizeIt. It sometimes shows objects refernced by
WeakReferences and finalizer only.
However if you encounter the memory leak again please feel free to
reopen this bug.
Comment 15 Quality Engineering 2003-07-01 16:00:43 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified.

Comment 16 Quality Engineering 2003-07-01 16:39:33 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.