Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
987 views
in Technique[技术] by (71.8m points)

jvm - Default values for Xmx, Xms, MaxPermSize on non-server-class machines

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...