How-To increase the Java Heap Space
When developing Java applications you sooner or later might run into a situation where Java does not have enough heap space. The main to reasons are: your application has a memory leak, or it really needs a lot of memory. This is often the case when you develop J2EE apps. To assign java more memory to avoid the following error message:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
you can assign more memory by setting:
java -Xms<initial heap size> -Xmx<maximum heap size>
The default values are:
java -Xms32m -Xmx128m
To increase the heap space you can either use the Java Control Panel or the command line.
Tagged as Java + Categorized as News