There a lot of JVM arguments that affect the JVM\'s memory usage like -Xms, -Xmx, -Xns, -XX:MaxPermSize...
-Xss: Stack size.
Used to set the size of your stack. Stack values only exist within the scope of the function they are created in. Once the function returns, they are discarded.
The easiest way to run out of stack space is to recurse too deep.
-Xms, -Xmx: Min and max heap size.
Used to set the size of your heap. The heap is where you allocate objects. Objects persist until they are garbage collected.
The easiest way to run out of heap space is to allocate something massive.
-XX:MaxPermSize: Permanent generation.
The permanent generation is special because it holds data needed by the virtual machine to describe objects that do not have an equivalence at the Java language level. For example objects describing classes and methods are stored in the permanent generation.
You usually run out of permgen space if you are somehow leaking references to classes you load dynamically. This plagues some web containers in particular.