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 183895 - Memory leak of a Document via debugger's properties
Summary: Memory leak of a Document via debugger's properties
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Other Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PERFORMANCE, TEST
Depends on:
Blocks:
 
Reported: 2010-04-12 11:39 UTC by Jaroslav Tulach
Modified: 2010-09-08 03:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2010-04-12 11:39:51 UTC
Apply patch: https://netbeans.org/bugzilla/attachment.cgi?id=97076
and when running the test you shall get (on rev. 470ae490543c):

Caused by: junit.framework.AssertionFailedError: Are all documents GCed?
TextDocument:
private static org.netbeans.api.debugger.Properties
org.netbeans.api.debugger.Properties.defaultProperties->
org.netbeans.api.debugger.Properties$PropertiesImpl@1bd29aa-pcs->
java.beans.PropertyChangeSupport@1e0b2e6-listeners->
sun.awt.EventListenerAggregate@f0f867-listenerList->
[Ljava.beans.PropertyChangeListener;@136be89-[2]->
org.netbeans.api.debugger.Properties$DelegatingProperties$DelegatingPropertyChangeListener@16e411d-delegate->
org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter$VariablesPreferenceChangeListener@1c549c5-this$0->
org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter@1751533-lookupProvider->
org.netbeans.api.debugger.Lookup$Compound@cac3cd-l1->
org.netbeans.api.debugger.Lookup$Compound@13052dc-l2->
org.netbeans.api.debugger.Lookup$Compound@1eeca9-l2->
org.netbeans.api.debugger.Lookup$MetaInf@162c0a5-instanceCache->
java.util.HashMap@1147313-table->
[Ljava.util.HashMap$Entry;@126de9b-[120]->
java.util.HashMap$Entry@1c6fb2c-value->
org.netbeans.modules.debugger.jpda.JPDADebuggerImpl@1caf24a-pcs->
java.beans.PropertyChangeSupport@b0bc90-children->
java.util.Hashtable@43e05e-table->
[Ljava.util.Hashtable$Entry;@168e379-[3]->
java.util.Hashtable$Entry@37755-value->
java.beans.PropertyChangeSupport@545d89-listeners->
sun.awt.EventListenerAggregate@17123e6-listenerList->
[Ljava.beans.PropertyChangeListener;@1d7b73c-[0]->
org.netbeans.modules.debugger.jpda.ui.CodeEvaluator@3f1e3d-codePane->
javax.swing.JEditorPane@1b58027-model->
org.netbeans.modules.editor.NbEditorDocument@808c1f-documentProperties->
org.netbeans.modules.editor.NbEditorDocument$4@19e7aba-table->
[Ljava.util.Hashtable$Entry;@10d9b3b-[7]->
java.util.Hashtable$Entry@1e2164-value->
org.netbeans.api.lexer.InputAttributes@a8e1c4-lp2attrs->
java.util.HashMap@600cf1-table->
[Ljava.util.HashMap$Entry;@60bb0b-[3]->
java.util.HashMap$Entry@1c30d23-value->
org.netbeans.api.lexer.InputAttributes$LPAttrs@1010bc1-globals->
java.util.HashMap@52ad89-table->
[Ljava.util.HashMap$Entry;@9e78c0-[4]->
java.util.HashMap$Entry@1ec12c8-value->
org.netbeans.modules.editor.NbEditorDocument@19e5b79
Comment 1 Jaroslav Tulach 2010-04-12 11:44:07 UTC
Found when working on bug 143586.
Comment 2 Daniel Prusa 2010-04-17 17:48:32 UTC
Fixed.

http://hg.netbeans.org/main/rev/dc1c95497afb
Comment 3 Quality Engineering 2010-04-18 04:18:59 UTC
Integrated into 'main-golden', will be available in build *201004180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/dc1c95497afb
User: Daniel Prusa <dprusa@netbeans.org>
Log: #183895: Memory leak of a Document via debugger's properties
Comment 4 Jaroslav Tulach 2010-04-20 13:41:36 UTC
I just tried to run:
$ ant -f java.kit/build.xml test-single -Dtest.type=qa-functional
-Dtest.includes=**/MemoryValidationTest*
and I can still see a reference via org.netbeans.modules.debugger.jpda.ui.CodeEvaluator
Comment 5 Martin Entlicher 2010-05-16 18:42:15 UTC
I did not see a reference through CodeEvaluator (please next time, provide every reference tree that you find). But I got this from the test:

    [junit] private static org.netbeans.modules.debugger.jpda.ui.debugging.FiltersDescriptor org.netbeans.modules.debugger.jpda.ui.debugging.FiltersDescriptor.instance->
    [junit] org.netbeans.modules.debugger.jpda.ui.debugging.FiltersDescriptor@873f8c-filters->
    [junit] java.util.ArrayList@9a2f8d-elementData->
    [junit] [Ljava.lang.Object;@1a49145-[0]->
    [junit] org.netbeans.modules.debugger.jpda.ui.debugging.FiltersDescriptor$Item@21d067-toggleButton->
    [junit] javax.swing.JToggleButton@18cdffe-parent->
    [junit] org.netbeans.modules.debugger.jpda.ui.debugging.InfoPanel$NoBorderToolBar@992216-parent->
    [junit] javax.swing.JPanel@ef19d4-parent->
    [junit] javax.swing.JViewport@1b7b97c-parent->
    [junit] javax.swing.JScrollPane@11f3190-parent->
    [junit] org.netbeans.modules.debugger.jpda.ui.debugging.InfoPanel@160c101-debuggingView->
    [junit] org.netbeans.modules.debugger.jpda.ui.debugging.DebuggingView@19a99c9-preferences->
    [junit] org.netbeans.core.startup.preferences.NbPreferences$UserPreferences@146e2c9-parent->
    [junit] org.netbeans.core.startup.preferences.NbPreferences$UserPreferences@18bce66-kidCache->
    [junit] java.util.HashMap@4d17f1-table->
    [junit] [Ljava.util.HashMap$Entry;@1246df9-[2]->
    [junit] java.util.HashMap$Entry@114aedc-value->
    [junit] org.netbeans.core.startup.preferences.NbPreferences$UserPreferences@d0f3-prefListeners->
    [junit] [Ljava.util.prefs.PreferenceChangeListener;@1c8f097-[0]->
    [junit] org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter$VariablesPreferenceChangeListener@7d57ad-this$0->
    [junit] org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter@422400-lookupProvider->
    [junit] org.netbeans.api.debugger.Lookup$Compound@51c9c6-l1->
    [junit] org.netbeans.api.debugger.Lookup$Compound@758fbd-l2->
    [junit] org.netbeans.api.debugger.Lookup$Compound@9644bf-l2->
    [junit] org.netbeans.api.debugger.Lookup$MetaInf@17b1dfe-instanceCache->
    [junit] java.util.HashMap@18934fe-table->
    [junit] [Ljava.util.HashMap$Entry;@181333-[120]->
    [junit] java.util.HashMap$Entry@39fc2f-value->
    [junit] org.netbeans.modules.debugger.jpda.JPDADebuggerImpl@b56b19-pcs->
    [junit] java.beans.PropertyChangeSupport@1cf960a-children->
    [junit] java.util.Hashtable@70b9c-table->
    [junit] [Ljava.util.Hashtable$Entry;@3fb623-[3]->
    [junit] java.util.Hashtable$Entry@9f95ba-value->
    [junit] java.beans.PropertyChangeSupport@1e406b7-listeners->
    [junit] sun.awt.EventListenerAggregate@10d320c-listenerList->
    [junit] [Ljava.beans.PropertyChangeListener;@2fb3f9-[0]->
    [junit] org.netbeans.modules.debugger.jpda.ui.CodeEvaluator@e649f1-codePane->
    [junit] javax.swing.JEditorPane@ae40d3-model->
    [junit] org.netbeans.modules.editor.NbEditorDocument@1bb1df2-documentProperties->
    [junit] org.netbeans.modules.editor.NbEditorDocument$4@81f78e-table->
    [junit] [Ljava.util.Hashtable$Entry;@13e446-[14]->
    [junit] java.util.Hashtable$Entry@5d5c5e-value->
    [junit] org.netbeans.api.lexer.InputAttributes@1716f0a-lp2attrs->
    [junit] java.util.HashMap@1273aeb-table->
    [junit] [Ljava.util.HashMap$Entry;@103a0aa-[2]->
    [junit] java.util.HashMap$Entry@fcd931-value->
    [junit] org.netbeans.api.lexer.InputAttributes$LPAttrs@19767e9-globals->
    [junit] java.util.HashMap@fc4e77-table->
    [junit] [Ljava.util.HashMap$Entry;@1053202-[4]->
    [junit] java.util.HashMap$Entry@512afd-value->
    [junit] org.netbeans.modules.editor.NbEditorDocument@8fae9c

UI elements should not be held in static fields.
Comment 6 Martin Entlicher 2010-05-16 18:48:13 UTC
Dane, can you please look at this? There's some TODO next to the Item.toggleButton field...
Comment 7 Martin Entlicher 2010-07-29 13:18:19 UTC
Fixed in changeset:   174978:292b4b6af47a
http://hg.netbeans.org/main/rev/292b4b6af47a
Comment 8 Quality Engineering 2010-07-30 03:07:08 UTC
Integrated into 'main-golden', will be available in build *201007300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/292b4b6af47a
User: mentlicher@netbeans.org
Log: #183895 Do not hold Swing components on a strong reference.
Comment 9 Martin Entlicher 2010-08-27 07:01:44 UTC
Reopening, the change http://hg.netbeans.org/main/rev/b5cb8ccc39d8 did not actually fix anything.
Comment 10 Martin Entlicher 2010-09-06 13:08:45 UTC
Fixed in changeset:   177083:cd87c1cdc04e
http://hg.netbeans.org/main/rev/cd87c1cdc04e
Comment 11 Quality Engineering 2010-09-07 03:13:06 UTC
Integrated into 'main-golden', will be available in build *201009070000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/cd87c1cdc04e
User: mentlicher@netbeans.org
Log: #183895 Add the listener as a weak listener only.
Comment 12 Quality Engineering 2010-09-08 03:29:44 UTC
Integrated into 'main-golden', will be available in build *201009080000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/cd87c1cdc04e
User: mentlicher@netbeans.org
Log: #183895 Add the listener as a weak listener only.