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 242048

Summary: OutOfMemoryError - Copying large output from Output Window
Product: platform Reporter: Exceptions Reporter <exceptions_reporter>
Component: Output WindowAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED FIXED    
Severity: normal CC: carlneto, malfunction84, rus20376
Priority: P2    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 207722
Attachments: stacktrace

Description Exceptions Reporter 2014-02-18 12:01:45 UTC
This bug was originally marked as duplicate of bug 232547, 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.51-b03, Java(TM) SE Runtime Environment, 1.7.0_51-b13
OS: Windows 7

User Comments:
GUEST: I ran an application that generated a large output. I couldn't save it to a file. I couldn't copy it to the clipboard. And I think NetBeans crashed when I closed it.

Every time I tried to copy the output to the clipboard I got a stack trace about copying an array. Do you really need to copy the array in heap space to allow it to be copied?

I mean: the output was in the output window, I could see it and scroll around, and it did fit in the JVM heap. The problem was trying to duplicate it.

GUEST: Copying a large piece of text. from the Job Output window, from a stopped job execution.




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOf(Arrays.java:2367)
   at java.lang.String.<init>(String.java:168)
   at java.nio.DirectCharBufferRS.toString(DirectCharBufferRS.java:416)
   at java.nio.CharBuffer.toString(CharBuffer.java:1201)
   at org.netbeans.core.output2.AbstractLines.getText(AbstractLines.java:202)
   at org.netbeans.core.output2.OutputDocument.getText(OutputDocument.java:173)
Comment 1 Exceptions Reporter 2014-02-18 12:01:47 UTC
Created attachment 145354 [details]
stacktrace
Comment 2 Jaroslav Havlin 2014-02-18 15:40:13 UTC
> I couldn't save it to a file.
What happened when you tried to save the output? Was an exception thrown? Thank you.
Comment 3 Jaroslav Havlin 2014-03-04 12:52:35 UTC
*** Bug 242522 has been marked as a duplicate of this bug. ***
Comment 4 Exceptions Reporter 2014-05-09 08:12:50 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=207722
Comment 5 Exceptions Reporter 2014-10-05 01:47:25 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=207722
Comment 6 Jaroslav Havlin 2015-07-07 14:37:13 UTC
http://hg.netbeans.org/core-main/rev/e71fe2fff948
Added a warning (confirmation) before selecting large part of text.

> I couldn't save it to a file.
Can you please provide more information? (Steps to reproduce.)

> Do you really need to copy the array in heap space to allow it to be copied?
Yes, the content is stored in a file-mapped memory, and we need a string representation.

Thank you for reporting.
Comment 7 Quality Engineering 2015-07-09 01:16:16 UTC
Integrated into 'main-silver', will be available in build *201507090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e71fe2fff948
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #242048: OutOfMemoryError - Copying large output from Output Window
Comment 8 Jaroslav Havlin 2015-08-12 13:56:50 UTC
*** Bug 252380 has been marked as a duplicate of this bug. ***
Comment 9 Jaroslav Havlin 2015-10-19 09:33:58 UTC
*** Bug 248692 has been marked as a duplicate of this bug. ***