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 250084 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-29 07:55 UTC by salmansayyad
Modified: 2015-08-07 01:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 213480


Attachments
stacktrace (2.15 KB, text/plain)
2015-01-29 07:55 UTC, salmansayyad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description salmansayyad 2015-01-29 07:55:18 UTC
Build: NetBeans IDE 8.0.1 (Build 201408251540)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b17
OS: Windows 7

User Comments:
GUEST: Error reporting

salmansayyad: Problem

GUEST: don't know, what I did




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.nio.DirectCharBufferRS.toString(DirectCharBufferRS.java:410)
   at java.nio.CharBuffer.toString(CharBuffer.java:1201)
   at org.netbeans.core.output2.AbstractLines.getText(AbstractLines.java:202)
   at org.netbeans.core.output2.AbstractLines.getLine(AbstractLines.java:360)
   at org.netbeans.core.output2.AbstractLines.getLineInfo(AbstractLines.java:955)
   at org.netbeans.core.output2.ExtPlainView.drawText(ExtPlainView.java:119)
Comment 1 salmansayyad 2015-01-29 07:55:20 UTC
Created attachment 151723 [details]
stacktrace
Comment 2 Jaroslav Havlin 2015-02-02 12:07:41 UTC
> salmansayyad: Problem
The heap size limit is too low (-Xmx386m) for running NetBeans.
Please increase it. See http://wiki.netbeans.org/FaqSettingHeapSize.

> GUEST: don't know, what I did 
Retained size of an instance of org.apache.tools.ant.module.bridge.impl.ForkedJavaOverride$Copier is 268 MB. Its currentLine (ByteArrayOutputStream) consumes most of this memory.

Reassigning to projects/Ant. Please evaluate.
Thank you.
Comment 3 Tomas Stupka 2015-05-29 14:14:22 UTC
see AbstractLInes.getText(int start, int end)
the attempt is made to print a buffer into _one_ line 

In case of all (currently three) heapdumps it looks like the buffer contained many many many megabytes - e.g. in case of 751617 180mb were supposed to be printed into one untruncated line in the output view ...
Comment 4 Jaroslav Havlin 2015-08-05 14:39:32 UTC
> supposed to be printed into one untruncated line in the output view
Thank you, Tomas. Output View truncates long lines (if line wrap is off). The problem was that the string with last line contents was constructed, although just it's length was needed.

Fixed in http://hg.netbeans.org/core-main/rev/86b7fff062e5.
Comment 5 Quality Engineering 2015-08-07 01:16:30 UTC
Integrated into 'main-silver', will be available in build *201508070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/86b7fff062e5
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #250084: Do not create string with line text if not necessary