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 240168 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
: 240169 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-09 16:57 UTC by westleyd
Modified: 2014-01-11 04:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 206430


Attachments
stacktrace (1.21 KB, text/plain)
2014-01-09 16:57 UTC, westleyd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description westleyd 2014-01-09 16:57:57 UTC
Build: NetBeans IDE 7.4 (Build 201310111528)
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:
westleyd: Diffing two 24MB text files with upper-ascii chars




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOf(Arrays.java:2367)
   at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
   at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
   at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
   at java.lang.StringBuilder.append(StringBuilder.java:132)
   at org.netbeans.modules.diff.builtin.provider.HuntDiff.getDifferences(HuntDiff.java:309)
Comment 1 westleyd 2014-01-09 16:57:59 UTC
Created attachment 143759 [details]
stacktrace
Comment 2 Ondrej Vrabec 2014-01-10 07:17:08 UTC
*** Bug 240169 has been marked as a duplicate of this bug. ***
Comment 3 Ondrej Vrabec 2014-01-10 10:22:00 UTC
Will try minor optimizations to save memory but you will get this error eventually at some point. The algorithm does not scale well, sooner or later it will throw an OOME when diffed files are really large. Even now the sizes of the files are already passed the threshold as you are told when trying to open them (you are notified and warned that it may not be safe before the diff process starts), So please be reasonable and don't try diffing too large files. Or if you really want to see the diff then increase -Xmx in netbeans.conf
BTW the files you are diffing look like dumps from a database and are completely different so you would eventually get just a complete trash of 250 000 lines where i suppose you would not see anything interesting.

fix: http://hg.netbeans.org/core-main/rev/3d6cb10d3ae7
Comment 4 Quality Engineering 2014-01-11 04:46:09 UTC
Integrated into 'main-silver', will be available in build *201401110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3d6cb10d3ae7
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #240168 - OutOfMemoryError: Java heap space
share string instances as long as possible until the computing finishes