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 189681 - Automatic tests fails with OutOfMemoryError
Summary: Automatic tests fails with OutOfMemoryError
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.0
Hardware: PC Linux
: P1 normal (vote)
Assignee: issues@editor
URL:
Keywords: TEST
: 187330 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-19 11:42 UTC by soldatov
Modified: 2010-09-25 21:47 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Document at time of endless loop (528 bytes, text/plain)
2010-08-24 15:50 UTC, Miloslav Metelka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2010-08-19 11:42:59 UTC
java.lang.OutOfMemoryError: Java heap space
        at org.netbeans.modules.editor.lib.impl.MarkVector.enlargeGap(MarkVector.java:722)
        at org.netbeans.modules.editor.lib.impl.MarkVector.insert(MarkVector.java:158)
        at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:125)
        at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816)
        at org.netbeans.modules.editor.lib2.view.ViewBuilder.createNextView(ViewBuilder.java:413)
        at org.netbeans.modules.editor.lib2.view.ViewBuilder.createViews(ViewBuilder.java:291)
        at org.netbeans.modules.editor.lib2.view.ViewUpdates.reinitViews(ViewUpdates.java:136)
        at org.netbeans.modules.editor.lib2.view.DocumentView$1.run(DocumentView.java:488)
        at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1409)
        at org.netbeans.modules.editor.lib2.view.DocumentView.reinitViews(DocumentView.java:478)
        at org.netbeans.modules.editor.lib2.view.DocumentView.propertyChange(DocumentView.java:1140)
        at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:196)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
        at org.netbeans.editor.BaseDocument$LazyPropertyMap.put(BaseDocument.java:2429)
        at org.netbeans.modules.editor.NbEditorDocument$4.put(NbEditorDocument.java:303)
        at javax.swing.text.AbstractDocument.putProperty(AbstractDocument.java:529)
        at org.netbeans.modules.options.indentation.FormattingPanelController$2.run(FormattingPanelController.java:197)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.jemmy.QueueTool$JemmyQueue.dispatchEvent(QueueTool.java:610)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
[catch] at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 soldatov 2010-08-19 11:43:53 UTC
/net/vvv-qa.russia.sun.com/export/home/tester/dump/heapdump.hprof
Comment 2 Vladimir Voskresensky 2010-08-20 21:07:30 UTC
Valera, does turning off line wrapping helps?
As I understand test started to fail exactly after the first NB version with line wrapping on?
Comment 3 soldatov 2010-08-23 07:57:46 UTC
Yes. If I add such line into code:
System.setProperty("org.netbeans.editor.linewrap", "false");

then OutOfMemoryError disappeares
Comment 4 Miloslav Metelka 2010-08-24 14:42:10 UTC
Thanks for the dump. There's 19 NbEditorDocument instances, they are mostly <1K. There's 1,955,223 instances of ParagraphView and they are all created from a single ViewBuilder so the code 

        if (doCreateViews) {
            // Create all new views
            while (createNextView()) {
            }
        }

have endless-looped. I have reconstructed the document's text and I'll attempt to reproduce the problem so that I can fix it.
Comment 5 Miloslav Metelka 2010-08-24 15:50:20 UTC
Created attachment 101640 [details]
Document at time of endless loop
Comment 6 Miloslav Metelka 2010-08-24 15:51:22 UTC
I would like to ask CND people if they could direct me to the test that fails? Thanks.
Comment 7 soldatov 2010-08-24 16:35:43 UTC
(In reply to comment #6)
> I would like to ask CND people if they could direct me to the test that fails?
> Thanks.
Very very thanks, Miloslav
Now I can reproduce bug. Scenario:
- Start NetBeans with fresh user directory and with -J-da
- Push Tools|Options
- Select Editor > Formatting tab
- Select C language
- Select ANSI, Apache, ... styles
- Select C++ language
- Select ANSI, Apache, ... styles
- Press OK button
==> OOM
Comment 8 Miloslav Metelka 2010-08-25 14:16:01 UTC
I was unable to reproduce OOME however when running with assertions enabled an assertion in ViewBuilder triggered. I have found the problem and I expect to have a fix within 2 hours.
Comment 9 Quality Engineering 2010-08-26 03:22:23 UTC
Integrated into 'main-golden', will be available in build *201008260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/12fdd8f7fa12
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #189681 - Automatic tests fails with OutOfMemoryError.
Comment 10 soldatov 2010-08-26 07:35:59 UTC
I launched automatic tests on 201008260001 build and tests finished without OOME.
P.S. Also I see empty "Preview" text area for C/C++/Fortran language (before and after fix). Is it other or related bug?
Comment 11 David Strupl 2010-08-26 09:51:09 UTC
I think that the preview bug is unrelated to this.
Comment 12 Miloslav Metelka 2010-08-26 10:33:18 UTC
http://hg.netbeans.org/jet-main/rev/12fdd8f7fa12

transplanted into release610_m1:
http://hg.netbeans.org/releases/rev/83347c556099
Comment 13 David Strupl 2010-09-25 21:47:14 UTC
*** Bug 187330 has been marked as a duplicate of this bug. ***