非服务器类机器上 Xmx、Xms、MaxPermSize 的默认值 [英] Default values for Xmx, Xms, MaxPermSize on non-server-class machines
问题描述
非服务器类机器上的 Java 6 中以下选项的默认值是什么?
- -Xmx
- -XX:MaxPermSize
Oracle 的 文档 指出:
Oracle's documentation states that:
在运行服务器 VM 的服务器级机器上,垃圾收集器 (GC) 已从以前的串行收集器 (-XX:+UseSerialGC) 更改为并行收集器 (-XX:+UseParallelGC).
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).
和
在运行带有并行垃圾收集器 (-XX:+UseParallelGC) 的 VM(客户端或服务器)的服务器级机器上,初始堆大小和最大堆大小已更改
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
该页面没有描述非服务器类机器的默认值,仅说明,例如,初始堆大小是合理的最小值".查看 手册页"java
命令有以下针对-Xms
:
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
推荐答案
Windows 7/32 位 JDK 1.6.0_29 的默认值:
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
然后查找 MaxHeapSize 和 MaxPermSize 键并查看默认值.
Then look for MaxHeapSize and MaxPermSize keys and see default values.
uintx InitialHeapSize := 199947456 {product}
uintx MaxHeapSize := 268435456 {product}
uintx MaxPermSize = 67108864 {pd product}
这里是 Ultimate HotSpot VM 选项备忘单,其中包含最近 5 个 JDK 版本的默认值和说明(7、8、9、10 和 11).
Here is the Ultimate HotSpot VM Options Cheat Sheet with defaults and descriptions for last 5 versions of JDK (7, 8, 9, 10 & 11).
这篇关于非服务器类机器上 Xmx、Xms、MaxPermSize 的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!