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 191872

Summary: OutOfMemoryError: Java heap space
Product: ide Reporter: dukeofgaming <dukeofgaming>
Component: PerformanceAssignee: Tomas Hurka <thurka>
Status: RESOLVED FIXED    
Severity: normal CC: 700x23, anebuzelsky, asashu75, bokc, mmirilovic, nomood, pjiricka, sj-nb, tpavek
Priority: P2 Keywords: PERFORMANCE, UMBRELLA
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter: 159199
Bug Depends on: 194447, 194448, 194449, 194450, 194451    
Bug Blocks:    
Attachments: stacktrace

Description dukeofgaming 2010-11-11 20:23:54 UTC
Build: NetBeans IDE 7.0 M2 (Build 201010151251)
VM: Java HotSpot(TM) 64-Bit Server VM, 16.3-b01, Java(TM) SE Runtime Environment, 1.6.0_20-b02
OS: Windows 7

User Comments:
nomood: at startup

700x23: Opened software -- Sanning projects....

GUEST: initial open

nomood: just opening netbeans. It was while netbeans was scanning projects

bokc: Starting NB

nomood: at startup

nomood: at startup




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOf(Arrays.java:2882)
   at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
   at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
   at java.lang.StringBuffer.append(StringBuffer.java:219)
   at org.netbeans.modules.project.ui.OpenProjectList.printMsg(OpenProjectList.java:177)
   at org.netbeans.modules.project.ui.OpenProjectList.log(OpenProjectList.java:162)
Comment 1 dukeofgaming 2010-11-11 20:23:59 UTC
Created attachment 102926 [details]
stacktrace
Comment 2 Jesse Glick 2010-11-11 21:28:52 UTC
Stack trace irrelevant for diagnosis.

heapdump-431835.hprof (306Mb) has a bunch of String's. org.apache.lucene.search.FieldSortedHitQueue seems to be keeping a Comparators.readerCache, though it ought to be weak; maybe a WeakHashMap value -> key error, or maybe the heap dump just does not reflect a complete GC. form.ComponentInspector.testAction.previews looks like it's holding on to some components.
Comment 3 Tomas Pavek 2010-11-19 16:51:24 UTC
GUI Builder is hardly responsible for this, form.ComponentInspector.testAction.previews holds just one instance of a previewed form, overall of just marginal size.

This bug collects OOMEs from different areas, somebody should file separate bugs for the individual reports with attached heap dumps. Here's a quick analysis of the heap dumps:

* heapdump-430821.hprof - over 200,000 files and lots of objects from versioning (cvs). Might be something related to FS or VCS/CVS, or just extremely large project.

* heapdump-430831.hprof - 84% in char[], runs out of memory during parsing in css parser (there is a local variable ArrayList with retained size of 300MB)
* heapdump-430840.hprof - looks like css parser again
* heapdump-431535.hprof - 92% in char[], css parser

* heapdump-430922.hprof - not heap space but PermGen, hibernate support loading some class for JDBC connection (but don't know if it is the culprit)

* heapdump-431835.hprof - tens of MB in org.apache.lucene.search.FieldCache$StringIndex (commented by Jesse)

* heapdump-437533.hprof - almost 90MB in char[] created when opening project during some logging (held as local variable in org.netbeans.modules.project.ui.OpenProjectList.printMsg)
Comment 4 Petr Jiricka 2011-01-18 20:08:02 UTC
Thanks for the analysis, I filed separate bugs for each of these cases - see the bugs this depends on. Changing this to an umbrella task.
Comment 5 Petr Cyhelsky 2012-06-11 07:19:29 UTC
It seems all the blocking issues are resolved - closing the issue.