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 249248 - Since upgrading to 8.0.2 have received a couple of Low Memory - Not enough memory to compile reports
Summary: Since upgrading to 8.0.2 have received a couple of Low Memory - Not enough me...
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.1
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
: 257056 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-12-10 04:37 UTC by brettryan
Modified: 2016-06-23 12:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (508.77 KB, text/plain)
2014-12-10 04:37 UTC, brettryan
Details
.npss file attached from NetBeans (787.50 KB, application/x-npss)
2014-12-10 04:39 UTC, brettryan
Details
.npss file attached from NetBeans (371.77 KB, application/x-npss)
2015-10-13 12:49 UTC, brettryan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brettryan 2014-12-10 04:37:28 UTC
Since upgrading to 8.0.2 I've had a few "Low Memory" reports with "Not enough memory to compile...".

It is possible though that this isn't the 8.0.2 upgrade, as about the same time I've started using ant based projects as I mostly use maven. These new projects specifically are for NetBeans module development and are quite basic, the most complex that I do have open is the NetBeans own project java.editor.

I shall attach a NetBeans profile snapshot, I was going to send the QUIT signal to the process, but there's two running and I'm not entirely sure which one should be killed, I've included these in case anyone can tell me which ID I should kill.

$: ps aux|grep -i netbeans
bryan           24309   4.9 10.6  6382224 1770964   ??  S    Sun12am 186:13.97 /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -Djdk.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home -classpath /Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/boot.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/org-openide-modules.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/org-openide-util-lookup.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/org-openide-util.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/boot_ja.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/boot_pt_BR.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/boot_ru.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/boot_zh_CN.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-modules_ja.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-modules_pt_BR.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-modules_ru.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-modules_zh_CN.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util-lookup_ja.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util-lookup_pt_BR.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util-lookup_ru.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util_ja.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util_pt_BR.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util_ru.jar:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/locale/org-openide-util_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/lib/tools.jar -Dnetbeans.default_userdir_root=/Users/bryan/Library/Application Support/NetBeans -Dnetbeans.dirs=/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/nb:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/ergonomics:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/ide:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/extide:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/java:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/apisupport:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/webcommon:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/websvccommon:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/enterprise:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/mobility:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/profiler:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/python:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/php:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/identity:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/harness:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/cnd:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/dlight:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/groovy:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/extra:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/javacard:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/javafx: -Dnetbeans.home=/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform -Dcom.apple.mrj.application.apple.menu.about.name=NetBeans -Xdock:name=NetBeans -Xdock:icon=/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/nb/netbeans.icns -Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -Xmx1024m -client -Xss2m -Xms32m -XX:PermSize=32m -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.java2d.noddraw=true -Dsun.java2d.dpiaware=true -Dsun.zip.disableMemoryMapping=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/Users/bryan/Library/Application Support/NetBeans/8.0.2/var/log/heapdump.hprof org.netbeans.Main --cachedir /Users/bryan/Library/Caches/NetBeans/8.0.2 --userdir /Users/bryan/Library/Application Support/NetBeans/8.0.2 --branding nb
bryan           30444   0.1  0.1  8280164   8488   ??  S    Mon01pm   1:22.18 /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/bin/java -Dderby.system.home=/Users/bryan/.netbeans-derby -classpath /Applications/NetBeans/glassfish-4.1/javadb/lib/derby.jar:/Applications/NetBeans/glassfish-4.1/javadb/lib/derbytools.jar:/Applications/NetBeans/glassfish-4.1/javadb/lib/derbynet.jar org.apache.derby.drda.NetworkServerControl start
bryan           24057   0.0  0.0  2472280    392   ??  S    Sun12am   0:00.06 /bin/bash /Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/platform/lib/nbexec --userdir /Users/bryan/Library/Application Support/NetBeans/8.0.2 --cachedir /Users/bryan/Library/Caches/NetBeans/8.0.2 --jdkhome  -J-Dcom.apple.mrj.application.apple.menu.about.name=NetBeans -J-Xdock:name=NetBeans -J-Xdock:icon=/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/nb/netbeans.icns --branding nb --clusters /Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/nb:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/ergonomics:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/ide:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/extide:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/java:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/apisupport:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/webcommon:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/websvccommon:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/enterprise:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/mobility:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/profiler:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/python:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/php:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/identity:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/harness:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/cnd:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/dlight:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/groovy:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/extra:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/javacard:/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/javafx: -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -L-XX:MaxPermSize=384m -J-Xmx1024m -J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true
bryan           33990   0.0  0.0  2432772    676 s001  S+    3:20pm   0:00.00 grep -i netbeans



Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Mac OS X version 10.10.1 running on x86_64
Java; VM; Vendor = 1.8.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.25-b02
Comment 1 brettryan 2014-12-10 04:37:49 UTC
Created attachment 150999 [details]
IDE log
Comment 2 brettryan 2014-12-10 04:39:20 UTC
Created attachment 151000 [details]
.npss file attached from NetBeans

.npss file
Comment 3 Tomas Hurka 2015-02-09 08:33:27 UTC
messages.log file is full of repetitive messages of the following type:

INFO [org.netbeans.api.java.source.ClassIndex]: Ignoring closed index:

please investigate it and reassign it to correct component. Thanks.
Comment 4 Tomas Zezula 2015-09-29 10:43:52 UTC
Fixed jet-main 74c749c8be1b
Comment 5 brettryan 2015-10-12 00:44:17 UTC
Testing with 8.1RC, this isn't fixed, in fact it's much worse. My IDE will now hang during background scanning for around 10 minutes and eventually fail with an out of memory.
Comment 6 brettryan 2015-10-12 00:44:52 UTC
Product Version: NetBeans IDE 8.1 RC (Build 201510012201)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Mac OS X version 10.11 running on x86_64; UTF-8; en_AU (nb)
User directory: /Users/bryan/Library/Application Support/NetBeans/8.1rc
Cache directory: /Users/bryan/Library/Caches/NetBeans/8.1rc
Comment 7 Tomas Zezula 2015-10-12 09:10:41 UTC
Please attach the NPSS file from 8.1RC.
Thanks
Comment 8 brettryan 2015-10-13 12:49:01 UTC
Created attachment 156689 [details]
.npss file attached from NetBeans

.npss file
Comment 9 brettryan 2015-10-13 12:51:50 UTC
Comment on attachment 156689 [details]
.npss file attached from NetBeans

Captured after and during trying to save a file to trigger CoS.

IDE was behaving mostly reliably for about 9 hours, now it's at a point where CoS will not work. It seems that something is being exhausted by objects not being released.


Product Version: NetBeans IDE 8.1 RC (Build 201510012201)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Mac OS X version 10.11 running on x86_64; UTF-8; en_AU (nb)
User directory: /Users/bryan/Library/Application Support/NetBeans/8.1rc
Cache directory: /Users/bryan/Library/Caches/NetBeans/8.1rc
Comment 10 pbelbin 2015-11-19 00:16:10 UTC
I am seeing this issue too.  With 8.1.

I tried opening the glassfish-4.1 source, and I'm getting notifications that it does not have enough memory to compile code.

note:

the Mac I'm using has 16GB of real memory, and I tried setting -J-Xmx4096m in the netbeans app etc/netbeans.conf file.  Using jconsole, connected to the netbeans process, jconsole, showing the vm options, appears to show a max heap of just under 1GB, even though I set the -Xmx option.

jconsole does report that I am running JDK 8u66.

Further, adding -XX:+UseG1GC causes NetBeans to not complete loading.  It shows the initial banner, and that it's loading modules, but then it stops.

manually starting netbeans, I see the following in the output:

Unknown option -XX:+UseG1GC
Comment 11 Tomas Zezula 2016-06-15 09:03:03 UTC
The snapshot selfsampler9189698978604519839.npss does not contain running java indexer. 
Probably the indexing was already finished.
Seems a memory leak in the IDE.
Please can you generate the heap dump by:
jmap -dump:live,format=b,file=heap.bin <pid>

upload it to out builder:
1) Compress the heap dump file using zip or gzip
2) Select a file using the Choose File button at http://deadlock.netbeans.org/hudson/job/upload/build
3) Press Build and wait until the upload completed (this will take a long time)
4) The job will display a link to the uploaded file - paste this link to the bug report
5) Attach the link to this issue.

Thanks.

I will try the glassfish-4.1 sources as described in comment #10.
Comment 12 Tomas Zezula 2016-06-15 16:42:17 UTC
I've fixed some minor case which may cause that javac may not be freed for a short period but it should not cause huge memory leaks as a next round will clean it.

jet-main ab90c3b965de

I've also added a possibility to automatically generate the heap dump in case of Low Memory (jmap is no more needed). To enable the heap dumper you need to run the IDE with the following command line option:

-J-Dorg.netbeans.modules.java.source.indexing.JavaCustomIndexer.dump.on.low.mem=<path_to_folder_to_save_heapdumps_into>

When the change will be available in nightly build I will attach a link to it.
Please run the IDE with the option and upload the heapdump as described in my previous comment.
Thanks a lot!
Comment 13 Tomas Zezula 2016-06-16 11:37:19 UTC
The builds with heap dump is now available at: http://bits.netbeans.org/download/trunk/nightly/latest/

I've tried the glassfish and no LowMemory happens (dev build with default settings).
Apparently the memory leak is not (not more) in the java indexing.
However it's possible that there is a memory leak in project type causing the Low Memory.

Please run the IDE with the above command line option, submit the heapdump and attach a link. I will use the build as well.
When I get a heapdump I will create an issue on correct component.

Thanks!
Comment 14 Quality Engineering 2016-06-17 01:51:57 UTC
Integrated into 'main-silver', will be available in build *201606170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ab90c3b965de
User: Tomas Zezula <tzezula@netbeans.org>
Log: #249248:Since upgrading to 8.0.2 have received a couple of Low Memory - Not enough memory to compile reports
Comment 15 Tomas Zezula 2016-06-23 12:31:17 UTC
*** Bug 257056 has been marked as a duplicate of this bug. ***