JVM optionsThe JVM Options are command line inputs to the VM. The JVM takes 2 different type of options.
* Options that begin with -X are non-standard (not guaranteed to be supported on all VM implementations) and are subject to change without notice in subsequent releases of the JDK.
* Options that are specified with -XX are not stable and are not recommended for casual use. These options are subject to change without notice.

Some options may vary per architecture/OS/JVM version.

* Boolean options are turned on with -XX:+<option> and turned off with -XX:-<option>.
* Numeric options are set with -XX:<option>=<number>. Numbers can include 'm' or 'M' for megabytes, 'k' or 'K' for kilobytes, and 'g' or 'G' for gigabytes (for example, 32k is the same as 32768).
* String options are set with -XX:<option>=<string>, are usually used to specify a file, a path, or a list of commands

Some Useful -X Options
-Xms40m Minimum Heap Size in MB
-Xmx256m Maximum Heap Size in MB

Some Useful -XX Options
-XX:MaxNewSize=size Maximum size of new generation (in bytes). Since 1.4, MaxNewSize is computed as a function of NewRatio.
-XX:MaxPermSize=64m Size of the Permanent Generation.

Example :
java -Xms40m -Xmx256m <classname to run>