Default values for Xmx, Xms, MaxPermSize on non-server-class machines
Asked Answered
M

1

50

What are the default values for the following options in Java 6 on a non-server-class machine?

  • -Xmx
  • -XX:MaxPermSize

Oracle's documentation states that:

On server-class machines running the server VM, the garbage collector (GC) has changed from the previous serial collector (-XX:+UseSerialGC) to a parallel collector (-XX:+UseParallelGC).

and

On server-class machines running either VM (client or server) with the parallel garbage collector (-XX:+UseParallelGC) the initial heap size and maximum heap size have changed

The page doesn't describe the defaults for non-server-class machines, only that, for example, the initial heap size is "a reasonable minimum". Looking at the 'man page' for the java command there is the following against -Xms:

The default value is chosen at runtime based on system configuration

Messinger answered 21/11, 2011 at 9:6 Comment(0)
K
73

Default values for JDK 1.6.0_29 on Windows 7/32-bit:

-Xmx256m
-XX:MaxPermSize=64m

Also value of these option can be printed by following command:

java -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version 2>&1

Then look for MaxHeapSize and MaxPermSize keys and see default values.

uintx InitialHeapSize                          := 199947456       {product}
uintx MaxHeapSize                              := 268435456       {product}           
uintx MaxPermSize                               = 67108864        {pd product}        

Here is the Ultimate HotSpot VM Options Cheat Sheet with defaults and descriptions for last 5 versions of JDK (7, 8, 9, 10 & 11).

Kippy answered 6/12, 2011 at 12:31 Comment(7)
I get Unrecognized VM option '+PrintFlagsFinal' when I try to run java -XX:+PrintFlagsFinalExtensile
Svish, what is version of your JVM?Kippy
Doesn't work with 1.5.0_22, but works with 1.7.0_07, so was this added in 1.6 or something?Extensile
What does "no default" mean here? What is the default when there is no default?Facula
Sorry, default value for -Xms option is stored with InitialHeapSize key.Kippy
Note that java -XX:+PrintFlagFinal outputs to stderr, so redirect with 2>&1 when grepping, e.g.: java -XX:+PrintFlagsFinal 2>&1 | grep PermSizePrinting
Permanent Generation has been removed as of Java 1.8 - openjdk.java.net/jeps/122 - so there is no MaxPermSize for 1.8 onwardsDuplicator

© 2022 - 2024 — McMap. All rights reserved.