Thursday, March 27, 2008

How to increase the Memory for JVM

Some times in your java programming the memory for JVM should be increased to avoid 'out of memory error'.

To do that we should specify the minimum and maximum memory for JVM by using the following command.

1. Go to Start button--> run command--> type cmd
2. Enter the path of the program to run
3. Give the command: java -Xms64m -Xmx256m classname of your program

In the above command -Xms is the minimum memory and -Xmx is the maximum memory. 64m is 64MB and 256m is 256MB.

By default the memory occupied by JVM is 64MB

No comments: