Search code examples
javanetbeans-platform

how to increase heap space of JVM in netbeans


On running my code it throws exception:

Exception in thread "AWT-EventQueue-1" java.lang.OutOfMemoryError: Java heap space

How to increase the heap space of JVM in netbeans 8??


Solution

  • Run->Set Project Configuration->Customize... You can enter your VM options in Run tab. Use the -Xmx[size] flag to increase the heap size. As size you can use for example 512m for 512MB or 2g for 2000MB.