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

痞子三分冷 提交于 2019-11-27 05:24:03

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/8209450/default-values-for-xmx-xms-maxpermsize-on-non-server-class-machines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!