Memory Usage in Java
You can allocate memory to the JVM when it starts up. This is to limit the amount of resources the JVM process can use your machine.
Exception: java.lang.OutOfMemoryError: Java heap space
If you see a OutOfMemoryError telling you about heap space, you could increase it using the -Xmx JVM parameter. e.g.
java -Xmx512m
To allocate a maximum of 512M of memory to the JVM.
Type "java -X" for a list of JVM specific standard parameters
Published: Saturday, 10 December 2011

