Skip to content
Advertisement

increasing heap size in netbeans.conf file

I was reading in netbeans 6, you don’t have to set the maximum heap size, it will just look at your computer for that information.

My system has 8 gigs of ram, but my application only has 64mb to play with and it is running out of memory.

I did a:

System.out.println(Runtime.getRuntime().maxMemory());

And it is 66 650 112 bytes (63.5625 megabytes).

my netbeans.config:

-J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m

I tried to change these numbers, but then netbeans failed to load (JVM error).

How can I increase the maximum size to 1 GB?

Advertisement

Answer

This command line give to your Java program a 64Mb initial and 256Mb maximum heap size.

java -Xms64m -Xmx256m jdbc_prog

Good luck!

Advertisement