Do Java Virtual Machine (JVM) implementations increase their memory at runtime if required?

Created May 4, 2012

James House

There's no guarantee by the JVM specification of any particular behavior with respect to the memory usage by the JREs. I.e., it's a matter that is up to the specific JVM implementor to decide.

Note that the Sun virtual machine implementations have command line parameters that can tell it how much memory to use initially, and how
much memory it can use maximally (how much the VM's
memory usage can grow to). If you don't specify
these parameters, the VM uses defaults. I believe that
the default maximum is typically 32 megabytes. If your
Java application is going to need to use more than this,
you'll have to start the VM with these extra parameters.

The parameters are: -Xms and -Xmx you can see help
for these parameters by typing "java -X" on the command-line.