Last days, I was working on a project which needs big heap size.And i always have the following exception "main" java.lang.OutOfMemoryError: Java heap space I found that the default java heap size is : 128MB , so my application need more about 1GP !!. So the solution was to make it larger using the following command :
In netBeans,Open the configuration file etc/netbeans.conf(In netBeans installed directory) and modify the #netbeans_default_options="-J-Xmx128m to -J-Xmx96m and -J-XX:MaxPermSize=96m to -J-XX:MaxPermSize=64m". This way also we have to increase the Heap size.