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 229402 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: RESOLVED DUPLICATE of bug 239360
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 12:40 UTC by Alniks
Modified: 2015-09-07 15:24 UTC (History)
24 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 200439


Attachments
stacktrace (1.24 KB, text/plain)
2013-05-06 12:40 UTC, Alniks
Details
stacktrace (1.24 KB, text/plain)
2013-10-08 14:25 UTC, franciscodiaztrepat
Details
stacktrace (922 bytes, text/plain)
2014-02-21 21:04 UTC, misterm
Details
stacktrace (922 bytes, text/plain)
2014-11-22 10:04 UTC, _ alexlamsl
Details
stacktrace (922 bytes, text/plain)
2015-02-09 11:42 UTC, _ alexlamsl
Details
stacktrace (1.05 KB, text/plain)
2015-03-20 04:27 UTC, misterm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alniks 2013-05-06 12:40:57 UTC
This bug was originally marked as duplicate of bug 223619, 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.3 (Build 201302132200)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.5-b03, Java(TM) SE Runtime Environment, 1.6.0_30-b12
OS: Windows 7

User Comments:
Alniks: tried to open big log file in nb




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at org.netbeans.modules.editor.lib2.document.ReadWriteUtils.read(ReadWriteUtils.java:74)
   at org.netbeans.editor.BaseDocument.read(BaseDocument.java:1433)
   at org.netbeans.editor.BaseKit.read(BaseKit.java:707)
   at org.openide.text.DataEditorSupport.loadFromStreamToKit(DataEditorSupport.java:487)
   at org.openide.text.CloneableEditorSupport.loadDocument(CloneableEditorSupport.java:2196)
   at org.openide.text.CloneableEditorSupport.access$2700(CloneableEditorSupport.java:129)
Comment 1 Alniks 2013-05-06 12:40:59 UTC
Created attachment 134134 [details]
stacktrace
Comment 2 Tomas Hurka 2013-05-24 15:09:41 UTC
org.netbeans.modules.editor.lib2.document.ReadWriteUtils.read() can be improved to use less memory especially for large files.
Comment 3 franciscodiaztrepat 2013-10-08 14:25:07 UTC
Created attachment 140889 [details]
stacktrace

I was loading a large text file. I thought it was 15 mb but it was 150mb.
Comment 4 misterm 2014-02-21 21:04:43 UTC
Created attachment 145480 [details]
stacktrace

.
Comment 5 _ alexlamsl 2014-11-22 10:04:01 UTC
Created attachment 150621 [details]
stacktrace

Start IDE
Comment 6 Marian Mirilovic 2015-02-04 10:27:43 UTC
166 duplicates -> P2
Comment 7 _ alexlamsl 2015-02-09 11:42:26 UTC
Created attachment 151900 [details]
stacktrace

opening a large text file (207MB)
Comment 8 misterm 2015-03-20 04:27:42 UTC
Created attachment 152734 [details]
stacktrace

Opening a large file (976mb)
Comment 9 Miloslav Metelka 2015-09-07 15:24:04 UTC
Alghough the editor document implementation is capable of repetitive insertions upon document read all the document listeners are triggered upon each insertion (including e.g. lexer's relexing etc.). So ReadWriteUtils.read() attempts to fully read the stream so that just a single insert is made which should be the most efficient approach.

As the ReadWriteUtils.read() can perform several memory allocations it's often shown in OOMEs but it does not itself leak the memory. All the current editor's memory leaks should be resolved in terms of issue #239360 so making this issue a dup of it.

*** This bug has been marked as a duplicate of bug 239360 ***