After thinking for a long time of a generic way to pose this question (and failing to find one) I\'m just going to ask it as a concrete example:
Suppose I have a Lin
If you have so much occupied memory that the free space cannot even sustain an idle JVM, you would get either some error saying the program has not enough memory, or the JVM would crash.
If you can run the JVM, you can specify the limit on heap space with -Xmx. That doesn't mean all the heap will be allocated by JVM on start - it is only an internal limit. If the JVM will want to increase the heap space, but there is not enough memory, or you need more heap than specified by -Xmx, you will get OutOfMemoryError in currently running Java programs.
In a very extreme condition, you can run out of free memory while the JVM is running, and at the same time the JVM requires more memory for its internal operation (not the heap space) - then the JVM tells you it needed more memory, but could not get any, and terminates, or it will crash outright.