| Exception in thread “main” java.lang.OutOfMemoryError: Java heap space |
When this exception occurs, it means java runs out of memory.
You can increase memory(heap size) by run java including these parameters
-Xms[initial heap size] -Xmx[maximum heap size]
For example, set initial heap size to 128m and maximum to 256m.
java -Xms128m -Xmx256m
In NetBeans, simply goes to Project Properties –> Run.
Then you can add these parameters in VM Options.
























March 13th, 2008 at 2:32 am
do you know how do i set initial heap size to 128m in Jcreator?
March 13th, 2008 at 9:03 am
I’m not sure on JCreator but there must be a setting similar to NetBeans that let you add argument when execute java.exe commmand.
November 19th, 2008 at 3:56 am
Hello. It is test.