If I omit the -Xmxn
option from the Java command line then a default value will be used. According to Java documentation
\"the default v
The Xms
and Xmx
are flag of Java virtual machine (JVM):
Xms
: initial and minimum
JVM heap size
Format
: -Xms[g|G|m|M|k|K]
Default Size
:
-server
mode: 25% of free physical memory, >=8MB and <= 64MB-client mode
: 25% of free physical memory, >=8MB and <= 16MBTypical Size
:
-Xms128M
-Xms256M
-Xms512M
Function
/Effect
:
Xms
size memoryXmx
: maximum
JVM heap size
Format
: -Xmx[g|G|m|M|k|K]
Default Size
:
<= R27.2
Windows
: 75%
of total physical memory up to 1GB
Linux/Solaris
: 50%
of available physical memory up to 1GB
>= R27.3
Windows X64
: 75%
of total physical memory up to 2GB
Linux/Solaris X64
: 50%
of available physical memory up to 2GB
Windows x86
: 75%
of total physical memory up to 1GB
Linux/Solaris X86
: 50%
of available physical memory up to 1GB
Typical Size
:
-Xmx1g
-Xmx2084M
-Xmx4g
-Xmx6g
-Xmx8g
Function
/Effect
:
Xmx
size memory
Xmx
, will java.lang.OutOfMemoryError
OutOfMemoryError
?
Xmx
value
-Xmx4g
to -Xmx8g
see official doc: -X Command-line Options