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 235483

Summary: OutOfMemoryError: GC overhead limit exceeded
Product: editor Reporter: 3rik
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: NEW ---    
Severity: normal CC: bb2eb, bdoolittle, BongoBob, dalcris, heriaileen, issues, jyeary, MorPheuZL, rsadkm, sbillard, Seb147, yib
Priority: P3 Keywords: PERFORMANCE
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 203556
Attachments: stacktrace

Description 3rik 2013-09-04 08:25:53 UTC
This issue was reported manually by thurka.
It already has 1 duplicates 

Build: NetBeans IDE 7.4 Beta (Build 201307092200)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_17-b02
OS: Windows 7

User Comments:
3rik: Tried to overwrite a large HTML file with lots of internal CSS and JavaScript with another large one.

java.lang.OutOfMemoryError: GC overhead limit exceeded
   at org.netbeans.modules.sampler.Sampler$
   at java.util.TimerThread.mainLoop(
Comment 1 3rik 2013-09-04 08:25:55 UTC
Created attachment 139641 [details]
Comment 2 Tomas Hurka 2013-09-04 08:49:37 UTC
There is a lot of org.netbeans.modules.editor.lib2.highlighting.HighlightItem instances and other instances from org.netbeans.modules.editor.lib2.view package. 34% of the heap is occupied by float[], most of which are held from org.netbeans.modules.editor.lib2.view.HighlightsView.
Comment 3 Exceptions Reporter 2013-10-31 17:07:48 UTC
This bug already has 5 duplicates 
Comment 4 Exceptions Reporter 2013-10-31 23:13:58 UTC
Created attachment 141757 [details]

Locked up when a file that was under Mercurial was reverted by a third-party application.
Comment 5 jyeary 2015-07-04 03:40:31 UTC
Created attachment 154483 [details]

The JS update is crashing the IDE.
Comment 6 timmaher 2015-08-14 15:22:13 UTC
(In reply to jyeary from comment #5)
> Created attachment 154483 [details]
> stacktrace
> The JS update is crashing the IDE.

Just happened to me to.
Comment 7 Miloslav Metelka 2016-06-15 14:33:26 UTC
Report #819749 shows a large number of HtmlLexer instances and I've found a serious error: HtmlLexer$CompoundState is a non-static inner class.
The lexer framework saves a lexer state together with token. There is no reason to hold lexer instances so each relex produces and uses a new lexer instance. However HtmlLexer$CompoundState being non-static holds a HtmlLexer instance together with its input and tokenFactory fields practically for every modification of an html source :(
I'll scan all *Lexer classes in all modules to ensure that this pattern was not copied to other lexer impls too.
Comment 8 Quality Engineering 2016-06-16 01:52:28 UTC
Integrated into 'main-silver', will be available in build *201606160002* on (upload may still be in progress)

User: Miloslav Metelka <>
Log: #235483 - OutOfMemoryError: GC overhead limit exceeded - fixed HtmlLexer compound state to not be non-static inner class.