0

I am well aware this issue exists but I wasn't able to find a fix (that works) yet. There's a quite big project I have to import/open in NetBeans 8.1 and this process just takes an eternity and causes several problems every time.

I started it in the command-line on Linux so here's the output:

qohelet@PC ~/netbeans-8.1/bin $ ./netbeans 
java.lang.OutOfMemoryError: GC overhead limit exceeded
Dumping heap to /home/users/qohelet/.netbeans/8.1/var/log/heapdump.hprof ...
Heap dump file created [1552345961 bytes in 15.428 secs]

You can see the problem right here, while the project scans I get several "Lack of Memory" messages which give forward me to the following Notification:

Resolve Parsing Problem

The IDE has detected slowness in parsing the project, which is caused by a lack of available memory. For solutions to this problem, search the IDE help for "Memory Requirements for Large Projects"

What do I actually want and why do I have 8.1?

I'm working on a C++ project that contains several Python and Perl Scripts. NB 8.1 is the last version that has (quite good) plugins for Python and Perl.

Just canceling the process doesn't work.

There are "solutions" to that, I know, so far none of them worked for me:

There are some switches for the netbeans.conf apparently to give more memory to the IDE, but it seems most of them are non existent any more. (Xmx)

Qohelet
  • 1,459
  • 4
  • 24
  • 41
  • 1
    Re using Xmx, here is a NetBeans 8.1 bug report response which urges the user to use Xmx to prevent OutOfMemoryError: https://netbeans.org/bugzilla/show_bug.cgi?id=257737 So what happens when you specify Xmx? – skomisa Jan 24 '18 at 19:13
  • Using `./netbeans -J-Xmx1500m` now, the issue is gone now. Seems I did use the parameter wrong – Qohelet Jan 25 '18 at 14:55
  • @skomisa - I built the project externally. Netbeans really has issues with that. Parsing the trunk like hell – Qohelet Feb 14 '18 at 10:50

1 Answers1

1

Just give it more memory.

Find "netbeans_default_options" in your netbeans.conf file add -J-Xmx option:

netbeans_default_options="-J-client -J-Xss4m -J-Xms64m -J-Xmx5G -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"

My NetBeans works pretty good with 5GB of RAM when I open whole linux kernel as a project.

Kamil
  • 13,363
  • 24
  • 88
  • 183