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 182123 - OutOfMemoryError: Java heap space
Summary: OutOfMemoryError: Java heap space
Status: RESOLVED DUPLICATE of bug 183289
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Victor Vasilyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-16 14:44 UTC by Karol Harezlak
Modified: 2010-03-31 15:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 162579


Attachments
stacktrace (1.37 KB, text/plain)
2010-03-16 14:44 UTC, Karol Harezlak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karol Harezlak 2010-03-16 14:44:22 UTC
Build: NetBeans IDE 6.8 (Build 200912041610)
VM: Java HotSpot(TM) Client VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03
OS: Linux

User Comments:
GUEST: no idea i started a find command

kharezlak: I've got it while I have it all Java FX project opend.

GUEST: I did nothig .. the message poped just up, sorry




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOf(Arrays.java:2882)
   at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
   at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572)
   at java.lang.StringBuilder.append(StringBuilder.java:203)
   at org.netbeans.modules.search.BufferedCharSequence.nextLineText(BufferedCharSequence.java:390)
   at org.netbeans.modules.search.BufferedCharSequence.getLineText(BufferedCharSequence.java:409)
Comment 1 Karol Harezlak 2010-03-16 14:44:31 UTC
Created attachment 95239 [details]
stacktrace
Comment 2 Karol Harezlak 2010-03-16 15:55:56 UTC
it may have something to do with searching and scanning project at once.
Comment 3 Victor Vasilyev 2010-03-17 05:14:39 UTC
(In reply to comment #2)
> it may have something to do with searching and scanning project at once.
... and also to all other things that consume memory, i.e. all without exception.
Unfortunately, the stack trace is showing the last JVM activities before the error only.

Nevertheless, search activities might be a cause of the error too.

Case 1 - A big list of the results.
Current implementation of the search relies on buffered reading of the files instead of loading whole files into the memory. It seriously reduce memory consuming, but it won't help in a case if a lot of the files are involved in the searching process, and many of files contains strings that are matched to a search condition specified by a user.

Case 2 - Specified search scope includes a big file containing too long line whose part is matched to the search condition. This assumption about a cause is closer to the attached stack trace.

So additional investigation is needed.
Will be better to have more info about conditions when the OOME occurs.
Comment 4 Victor Vasilyev 2010-03-31 15:00:29 UTC

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