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 - OutOfMemoryError - Copying large output from Output Window
Summary: OutOfMemoryError - Copying large output from Output Window
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
: 242522 248692 252380 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-02-18 12:01 UTC by Exceptions Reporter
Modified: 2015-10-19 09:33 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 207722


Attachments
stacktrace (2.50 KB, text/plain)
2014-02-18 12:01 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
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. ***