If I omit the -Xmxn option from the Java command line a default value is used. According to Java documentation "the default value is chosen at runtime based on system configuration".
What system configuration settings influence the default value?
解决方案
On Windows systems, you can use the following command to find out the defaults on the system where your applications runs.
java -XX:+PrintFlagsFinal -version | findstr HeapSize
Look for the options MaxHeapSize (for -Xmx) and InitialHeapSize for -Xms.
On a Unix/Linux system, you can do
java -XX:+PrintFlagsFinal -version | grep HeapSize
I believe the resulting output is in bytes.