The NetBeans IDE has a default heap size of 128 MB. This heap size is adequate if you are using NetBeans C/C++ Development Pack to develop small applications with up to 100 source files. If you are developing applications with more than 100 source files, you need to increase the heap size or you might get out of memory exceptions from the built-in parser.
You can set the heap size for the JVM on which the NetBeans IDE runs in the netbeans.conf file.
To change the heap size:
# command line switches netbeans_default_options="-J-Xms32m -J-Xmx128m -J-XX:PermSize=32m -J-XX:MaxPermSize=96m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"
The recommended heap sizes for NetBeans C/C++ Development Pack for medium-sized and large applications are:
To insure that you do not run out of memory while the built-in parser is running, you can also add the garbage collector switches -J-XX:+UseConcMarkSweepGC (concurrent collector) and -J-XX:+UseParNewGC (parallel collector) to the netbeans.conf file.