1

I have a project that has approximately 2000 files (not including library files) that I want to build.

In netbeans 6.9, I was getting "out of memory" error even when I increased the heap to 1 GB. But I got by it by building few packages at a time.

But in netbeans 7.2, I am not able to do this. Even for packages containing 30 files, I sometime get the "out of memory" error.

So, what is the maximum number of files that can be build simultaneously?

How do I get over this problem?

The heap size is 1GB.

UPDATE:

My machine is running Windows 7, 32 bit on a 64-bit machine. Currently, I can't reinstall a 64-bit windows 7. Other configurations, 4 GB RAM. Intel Core 2 quad CPU 2.66Hz.

netbeans conf.:

netbeans_default_options="-J-client -J-Xss2m -J-Xms384m -J-Xmx1024M -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true"

ollo
  • 24,797
  • 14
  • 106
  • 155
Harke
  • 1,279
  • 4
  • 25
  • 30

2 Answers2

1

I have a java project containing about 2400 source files and it builds fine within 50-60 seconds.

I don't expect Netbeans to have a limitation, Any limitation that you may have is probably hardware/setup related.

I start Netbeans with the following options:

netbeans_default_options="-J-client -J-Xss32m -J-Xms256m -J-Xmx1g -J-XX:PermSize=64m -J-XX:+UseConcMarkSweepGC -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true"

Those options are located in install_dir/etc/netbeans.conf

setup:

Core i7 with 10GB ram running jdk1.6.0_33 on Windows 7 64 bit

epoch
  • 16,396
  • 4
  • 43
  • 71
  • So, you means this could be because of hardware? I increased the heap size from the netbeans.conf file. – Harke Sep 17 '12 at 14:22
  • imo, it is possible, also heap size is not the only thing affecting OOM errors, have you tried with my `conf` file setup? – epoch Sep 17 '12 at 14:23
  • Yup. I just put some info from my conf. file in my question right now. – Harke Sep 17 '12 at 14:25
  • additionally, after I saw your update, you should get a better machine. that may ultimately be your problem... – epoch Sep 17 '12 at 14:28
  • Not exactly the answer I was looking for. That's not an option for me right now. Is there anyway I can tune the JVM?? – Harke Sep 17 '12 at 15:57
  • You can tune a go-cart all you want, it wont go 100mph. :) there are some good resources on Jvm tuning on the net though, i would start there. – epoch Sep 17 '12 at 19:11
0

"out of memory" could be caused by heap size or permgen size. You could use jVisualVM in your jdk/bin to monitor the memory usage.

From your setting, "-J-XX:PermSize=32m" in addition to NetBeans behavior: "Note that default -Xmx and -XX:MaxPermSize are selected for you automatically.". I guess it could be due to PermGen size.

You can try to set "-J-XX:PermSize=128m" (For my case, the startup of NetBeans is faster after I increased the permsize.)

Tan Hui Onn
  • 424
  • 4
  • 8