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 238755 - Unexpected Exception Java.lang.OutOfMemoryError: Java Heap Space
Summary: Unexpected Exception Java.lang.OutOfMemoryError: Java Heap Space
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: 8.0_HR_FIX
: 244560 246772 250061 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-25 10:28 UTC by GlowCoRuss
Modified: 2015-02-09 17:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log file as requested in the error message. (56.76 KB, text/plain)
2013-11-25 10:28 UTC, GlowCoRuss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description GlowCoRuss 2013-11-25 10:28:29 UTC
Created attachment 142530 [details]
messages.log file as requested in the error message.

I would very much like to be able to use Netbeans 7.4.

The IDE had been running the "Background scanning of projects..." process at 25% for about 3 days.

I decided to try and use it anyway - it's supposed to be asynchronous, right?

So I created a new .js file in my project, then I noticed the little red notification icon, which asked me to report the error here. 

I'm attaching my messages.log file as requested.
Comment 1 Tomas Hurka 2013-11-25 15:11:30 UTC
Please upload zipped heap dump (C:\Users\russ.GLOW\AppData\Roaming\NetBeans\7.4\var\log\heapdump.hprof) here: <http://deadlock.netbeans.org/job/upload/build?delay=0sec>. Make sure you are running NetBeans on 64bit JDK/JRE. Currently you are using 
C:\Program Files (x86)\Java\jre7
which is 32bit one.
Comment 2 GlowCoRuss 2013-11-25 16:22:10 UTC
Thanks for the reply,

I uploaded a zipped copy of the heapdump.hprof file at the address provided. 

It didn't give me a confirmation or reference number, but I suspect the upload might be this one:
http://deadlock.netbeans.org/job/upload/348/

I gave an "Upload_Name" of 238755, after this bug report number, if that helps.

I downloaded and installed a 64 bit JRE (from http://www.oracle.com/technetwork/java/javase/downloads/java-se-jre-7-download-432155.html) and am currently testing 7.4 again with no alerts in the last hour, which is better.
Comment 3 GlowCoRuss 2013-11-25 17:31:48 UTC
Still getting errors but I can't see where to check or set which JRE is being used by Netbeans.

Incidentally, Netbeans 7.4 looks like it's installed in "C:\Program Files (x86)\" which suggests that it isn't a 64bit application, but previous versions have installed in "C:\Program Files\".

I had a quick look at the download page but I can't find an option to explicitly download a 64bit Netbeans 7.4
Comment 4 GlowCoRuss 2013-11-26 09:06:14 UTC
Found a combined Netbeans 7.4 and JDK 7 download here
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-download-432126.html

this download gives a choice for 64 bit, so I'm trying that.
Comment 5 Petr Cyhelsky 2013-11-26 09:28:38 UTC
(In reply to GlowCoRuss from comment #3)
> Still getting errors but I can't see where to check or set which JRE is
> being used by Netbeans.

go to Help|About

> Incidentally, Netbeans 7.4 looks like it's installed in "C:\Program Files
> (x86)\" which suggests that it isn't a 64bit application, but previous
> versions have installed in "C:\Program Files\".

Netbeans is a java aplication - it runs in JVM and only whether the JVM is 64-bit or 32-bit matters. Where it is installed is unimportant.

> I had a quick look at the download page but I can't find an option to
> explicitly download a 64bit Netbeans 7.4

There is no such thing.
Comment 6 GlowCoRuss 2013-11-26 10:14:10 UTC
Thanks for the tips:

I was looking at the help | about box, but it was only giving me a Java version number - no indication of 32 or 64 bit. I realise now that this meant I was still using a 32 bit JVM. I do have both 32 bit and 64bit JVMs installed, from what I can tell, but I couldn't see anywhere to change that for Netbeans.

I uninstalled Netbeans 7.4 and reinstalled from the bundled JDK and Netbeans 7.4 that I mentioned above, this installed in the C:\Program Files\ folder and includes a Netbeans.exe and a Netbeans64.exe file, This looks more convincing to a dumb user like myself despite what you've explained to me above about only the JVM being important.

Running Netbeans64.exe and clicking help | about shows this line:
"Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08" which didn't use to have "64-bit" in there, so that's improved.

I'm just waiting for the initial "Background scanning of projects..." to finish, to see if the error notification pops up again.
Comment 7 Tomas Hurka 2013-11-26 13:40:46 UTC
(In reply to GlowCoRuss from comment #2)
> Thanks for the reply,
> 
> I uploaded a zipped copy of the heapdump.hprof file at the address provided. 
> 
> It didn't give me a confirmation or reference number, but I suspect the
> upload might be this one:
> http://deadlock.netbeans.org/job/upload/348/
> 
> I gave an "Upload_Name" of 238755, after this bug report number, if that
> helps.
Thanks for the heap dump. I have it. I don't see anything suspicious in the heap dump. The attached messages.log shows that you are using C:\www\magento-dev as source root and this has 123,090 files, which all need to be indexed.
Reassigning to editor/parsing to evaluate if it is OK that retain size of  org.apache.lucene.store.RAMFile instances is 298,942,080 bytes, which is 58.2% of the heap.
Anyway when you will use 64bit JDK, the situation should improve because NetBeans can use more memory.
Comment 8 GlowCoRuss 2013-11-26 15:42:46 UTC
I was still having out of memory errors on that project, even after switching to the 64-bit JVM.

Yes my working copy is a biggie, although I hadn't realised that it had gotten quite that large. Most of those files are Subversion overhead, created over several months of past development.

I've created a new working copy for the project with only 29,292 files.
So far, using the smaller working copy, I haven't seen another out of memory error.
Comment 9 Tomas Zezula 2014-02-18 18:37:15 UTC
Is it possible to download the heap file somewhere?
Comment 10 Tomas Zezula 2014-02-19 18:23:00 UTC
Caused by one big index loading into RAM.
Big indices which do not fit into RAM are never loaded.
Fixed jet-main 8fac5140e99e
Comment 11 Quality Engineering 2014-02-20 03:03:11 UTC
Integrated into 'main-silver', will be available in build *201402200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8fac5140e99e
User: Tomas Zezula <tzezula@netbeans.org>
Log: #238755:Unexpected Exception Java.lang.OutOfMemoryError: Java Heap Space
Comment 12 Dusan Balek 2014-02-20 13:46:10 UTC
Seems good to me.
Comment 13 Tomas Zezula 2014-02-20 14:14:45 UTC
Transplanted 2920c9772e91
Comment 14 Quality Engineering 2014-02-21 01:29:33 UTC
Integrated into 'releases/release80', will be available in build *201402202300* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/2920c9772e91
User: Tomas Zezula <tzezula@netbeans.org>
Log: #238755:Unexpected Exception Java.lang.OutOfMemoryError: Java Heap Space
Comment 15 Tomas Hurka 2014-05-17 06:28:04 UTC
*** Bug 244560 has been marked as a duplicate of this bug. ***
Comment 16 Tomas Hurka 2014-08-30 07:30:43 UTC
*** Bug 246772 has been marked as a duplicate of this bug. ***
Comment 17 Tomas Zezula 2015-02-09 17:44:11 UTC
*** Bug 250061 has been marked as a duplicate of this bug. ***