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 241847 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 22:16 UTC by bjones598
Modified: 2015-09-02 05:17 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 207589


Attachments
stacktrace (561 bytes, text/plain)
2014-02-13 22:16 UTC, bjones598
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bjones598 2014-02-13 22:16:43 UTC
This bug was originally marked as duplicate of bug 213339, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.4 (Build 201310111528)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Windows 7

User Comments:
rptmaestro: Happened several minutes after I had stopped working.

itmaster: erro

bjones598: Closed out a project, but in the "main-Navigator" portion of the screen, it still showed the class I was working on. I double-clicked on it and there the problem started.

GUEST: IDK?

GUEST: it occured on clicking variables in my code




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:149)
   at java.lang.StringCoding.decode(StringCoding.java:193)
   at java.lang.String.<init>(String.java:416)
   at java.io.ByteArrayOutputStream.toString(ByteArrayOutputStream.java:232)
   at org.apache.tools.ant.module.bridge.impl.ForkedJavaOverride$Copier.maybeFlush(ForkedJavaOverride.java:358)
   at org.apache.tools.ant.module.bridge.impl.ForkedJavaOverride$Copier.run(ForkedJavaOverride.java:340)
Comment 1 bjones598 2014-02-13 22:16:46 UTC
Created attachment 145170 [details]
stacktrace
Comment 2 Tomas Hurka 2014-02-14 08:25:18 UTC
The OOME is thrown from the flowing place:
 
Out Thread for {0} (run)" daemon prio=3 tid=150 RUNNABLE
	at java.lang.OutOfMemoryError.<init>(OutOfMemoryError.java:48)
	at java.util.Arrays.copyOf(Arrays.java:2271)
	at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
	at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
	at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:122)
	at org.apache.tools.ant.module.bridge.impl.ForkedJavaOverride$Copier.run(ForkedJavaOverride.java:332)
	at java.lang.Thread.run(Thread.java:744)

The problem is that ByteArrayOutputStream is too large, probably because the ant process outputs excessive amount of data. Reassigning to project/ant for further evaluation.
Comment 3 Exceptions Reporter 2014-09-16 20:54:07 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=207589
Comment 4 Tomas Stupka 2015-09-01 16:33:59 UTC
looks like too many hundred megabytes are printed into one line by user code. 
when ForkedJavaOverride tries to print (copy) the relevant bytearray, the error appears

can flush the byte array stream more often, not only on line end, but sooner or later the ide might get into its knees anyway.
Comment 5 Tomas Stupka 2015-09-01 16:42:42 UTC
fixed in jet-main #3d67567b6b92
Comment 6 Quality Engineering 2015-09-02 05:17:12 UTC
Integrated into 'main-silver', will be available in build *201509020320* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3d67567b6b92
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #241847 - OutOfMemoryError: Java heap space