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 183266 - Memory leak in editor
Summary: Memory leak in editor
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: PC Linux
: P1 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 183296 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-31 13:12 UTC by dnikitin
Modified: 2010-04-02 04:56 UTC (History)
4 users (show)

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 dnikitin 2010-03-31 13:12:22 UTC
Product Version         = NetBeans IDE Dev (Build cnd-main-3150-on-100330) 
Operating System        = Linux version 2.6.18-90.el5 running on amd64
Java; VM; Vendor        = 1.6.0_14; Java HotSpot(TM) 64-Bit Server VM 14.0-b16; Sun Microsystems Inc.
Runtime                 = Java(TM) SE Runtime Environment 1.6.0_14-b08
------------------------------------------------------------------

It seems there is memory leak in new editor.

cnd performance test hangs because of the following exception

if I run tests with flag -J-Dorg.netbeans.editor.linewrap.disable=true 
then exception will disappear and all tests will succeed



java.lang.OutOfMemoryError: GC overhead limit exceeded
        at sun.font.GlyphLayout$SDCache.get(GlyphLayout.java:312)
        at sun.font.GlyphLayout.layout(GlyphLayout.java:367)
        at sun.font.ExtendedTextSourceLabel.createGV(ExtendedTextSourceLabel.java:308)
        at sun.font.ExtendedTextSourceLabel.getGV(ExtendedTextSourceLabel.java:294)
        at sun.font.ExtendedTextSourceLabel.createLogicalBounds(ExtendedTextSourceLabel.java:208)
        at sun.font.ExtendedTextSourceLabel.getAdvance(ExtendedTextSourceLabel.java:117)
        at java.awt.font.TextLine.init(TextLine.java:264)
        at java.awt.font.TextLine.<init>(TextLine.java:110)
        at java.awt.font.TextLine.fastCreateTextLine(TextLine.java:952)
        at java.awt.font.TextLayout.fastInit(TextLayout.java:585)
        at java.awt.font.TextLayout.<init>(TextLayout.java:374)
        at org.netbeans.modules.editor.lib2.view.HighlightsView.createTextLayout(HighlightsView.java:176)
        at org.netbeans.modules.editor.lib2.view.HighlightsView.createTextLayout(HighlightsView.java:153)
        at org.netbeans.modules.editor.lib2.view.TextLayoutCache.get(TextLayoutCache.java:116)
        at org.netbeans.modules.editor.lib2.view.ParagraphView.getTextLayout(ParagraphView.java:141)
        at org.netbeans.modules.editor.lib2.view.HighlightsView.getTextLayout(HighlightsView.java:191)
        at org.netbeans.modules.editor.lib2.view.HighlightsView.getPreferredSpan(HighlightsView.java:98)
        at org.netbeans.modules.editor.lib2.view.EditorBoxViewChildren.replace(EditorBoxViewChildren.java:165)
        at org.netbeans.modules.editor.lib2.view.EditorBoxView.replace(EditorBoxView.java:257)
        at org.netbeans.modules.editor.lib2.view.ViewReplace.replaceViews(ViewReplace.java:108)
        at org.netbeans.modules.editor.lib2.view.ViewBuilder.repaintAndReplaceViews(ViewBuilder.java:414)
        at org.netbeans.modules.editor.lib2.view.ViewUpdates.reinitViews(ViewUpdates.java:133)
        at org.netbeans.modules.editor.lib2.view.DocumentView.reinitViews(DocumentView.java:360)
        at org.netbeans.modules.editor.lib2.view.DocumentView.checkViewsInited(DocumentView.java:349)
        at org.netbeans.modules.editor.lib2.view.DocumentView.propertyChange(DocumentView.java:833)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
        at java.awt.Component.firePropertyChange(Component.java:8128)
        at org.openide.text.QuietEditorPane.firePropertyChange(QuietEditorPane.java:204)
        at javax.swing.JComponent.addNotify(JComponent.java:4686)
        at java.awt.Container.addNotify(Container.java:2578)
[catch] at javax.swing.JComponent.addNotify(JComponent.java:4685)
Comment 1 David Strupl 2010-03-31 21:12:35 UTC
I will try to play with the profiler. BTW any easy way for me to start the tests that will end up with the exception?
Comment 2 David Strupl 2010-04-01 09:34:55 UTC
*** Bug 183296 has been marked as a duplicate of this bug. ***
Comment 3 David Strupl 2010-04-01 09:37:34 UTC
It seems that the problem is in method checkSettingsInfo in DocumentView on lines 476-480. The lookup listener leaks the documents. It can be verified that just by openning and closing the editor for the same files the number of DocumentView intances grows.
Comment 4 Miloslav Metelka 2010-04-01 10:10:01 UTC
Apologies, the lookup listener was not weak in DocumentView.
http://hg.netbeans.org/jet-main/rev/80e646442219
Comment 5 Quality Engineering 2010-04-02 04:56:57 UTC
Integrated into 'main-golden', will be available in build *201004020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/80e646442219
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #183266 - Memory leak in editor.