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.
Run commit validation with one additional test enabled, as described in issue 121855, and you will get: private static org.netbeans.modules.javahelp.JavaHelp org.netbeans.modules.javahelp.Installer.help-> org.netbeans.modules.javahelp.JavaHelp@183cff3-lastJH-> javax.help.JHelp@1f9c025-contentViewer-> javax.help.JHelpContentViewer@417ad4-ui-> javax.help.plaf.basic.BasicContentViewerUI@86a78b-vp-> javax.swing.JViewport@1cfd851-componentListener-> javax.swing.text.html.HTMLEditorKit$HTMLFactory$BodyBlockView@10eb439-attr-> javax.swing.text.html.StyleSheet$ViewAttributeSet@82f1a1-attrs-> [Ljavax.swing.text.AttributeSet;@fb7e63-[0]-> javax.swing.text.html.StyleSheet$ResolvedStyle@f041ba-attrs-> [Ljavax.swing.text.AttributeSet;@90f865-[1]-> javax.swing.text.html.StyleSheet$ResolvedStyle@5c159-attrs-> [Ljavax.swing.text.AttributeSet;@1dfad8c-[1]-> javax.swing.text.html.StyleSheet$ResolvedStyle@a64fd5-attrs-> [Ljavax.swing.text.AttributeSet;@f9ba76-[0]-> javax.swing.text.StyleContext$NamedStyle@1c0e8aa-this$0-> javax.swing.text.html.StyleSheet@430cca-css-> javax.swing.text.html.CSS@17fda21-styleSheet-> javax.swing.text.html.StyleSheet@1c4877b-styles-> javax.swing.text.StyleContext$NamedStyle@b9f6de-listenerList-> javax.swing.event.EventListenerList@957cae-listenerList-> [Ljava.lang.Object;@1f056cb-[1]-> javax.swing.text.DefaultStyledDocument$StyleContextChangeHandler@14b80d4-this$0-> javax.swing.text.html.HTMLDocument@25b43e-listenerList-> javax.swing.event.EventListenerList@551887-listenerList-> [Ljava.lang.Object;@1e65eed-[1]-> javax.swing.text.DefaultCaret$Handler@355fd4-this$0-> javax.swing.plaf.basic.BasicTextUI$BasicCaret@166825e-component-> javax.swing.JEditorPane@1e2b917-parent-> javax.swing.JViewport@f87be4-parent-> javax.swing.JScrollPane@f146ac-parent-> org.netbeans.modules.project.ui.TemplatesPanelGUI@1d7b2d1-parent-> org.netbeans.modules.project.ui.TemplateChooserPanelGUI@41d54b-project-> org.netbeans.modules.java.j2seproject.J2SEProject@1ad37f6
Project should release UI component when closed. Javahelp keeps reference to last opened javahelp instance so that if user reopens Help window it will be in the state when closed AND reopen is fast.
And what if lastJH would be weak/soft reference?
This does not work as reopening of Help window would sometimes show last opened help context (when lastJH is kept) and sometimes default help context (when lastJH would be gc'ed). It would result in random behavior - very bad from user point of view. I assume project knows when it is closed so that it will not use any UI anymore - the best moment to release its references to Swing components. Yes then Swing components will be still kept in memory because of Swing but it is Swing problem. Project instance itself (org.netbeans.modules.java.j2seproject.J2SEProject@1ad37f6 from log) could be gc'ed. IMO root problem is Swing impl when 2 independent Swing components are connected through internal references. It would be good to write simple test case and file issue against Swing.
*** Issue 124711 has been marked as a duplicate of this issue. ***
Fixed. http://hg.netbeans.org/main/rev/6ba7dab8f13a
fixed
Have to roll this back (d3a8f4b148ed). It results in TemplateChooserPanel.getProject() returning null, which wreaks all kinds of havoc; for example, trying to run the Wizard wizard on a module project, after selecting the template if you click Next you get NPEs and the wizard does not advance.
I did couple of tests, but unfortunately not enough.
This memory leak is in fact problem in swing and I found out that when running on JDK 1.6 this memory leak is not detected, so it's probably fixed. I suppose we could close this issue. Jardo?
changeset: 68108:57515bb70892 tag: tip user: Jaroslav Tulach <jtulach@netbeans.org> date: Thu Feb 21 16:30:17 2008 +0100 summary: #124710: When the panel is being hidden, cleanup its internal reference to project
changeset: 68111:d7dca03618b3 tag: tip user: Jaroslav Tulach <jtulach@netbeans.org> date: Fri Feb 22 14:41:36 2008 +0100 summary: #124710: Removing the editor pane from the html panel description as it seems to cause memory leak
v/c