有人会认为查找列出不同JVM版本的默认最大堆大小的表格很容易......但是快速搜索没有找到这样的东西。
那么,各个Sun JVM的默认最大堆大小是多少?
有人会认为查找列出不同JVM版本的默认最大堆大小的表格很容易......但是快速搜索没有找到这样的东西。
那么,各个Sun JVM的默认最大堆大小是多少?
根据系统配置在运行时选择默认值。 对于服务器部署, -Xms 和 -Xmx 通常设置为相同的值。 有关更多信息,请参见HotSpot Ergonomics
深入文档中的内部隐藏文档它说:The following changes take effect with J2SE 5.0. Garbage Collector of Server VM Changed to Parallel Garbage Collector
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). You can override this default by using the -XX:+UseSerialGC command-line option to the java command. Initial Heap Size and Maximum Heap Size Changed for Parallel Garbage Collector
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 as follows.
Initial heap size: Larger of 1/64th of the machine's physical memory on the machine or some reasonable minimum. Before J2SE 5.0, the default initial heap size was a reasonable minimum, which varies by platform. Maximum heap size: Smaller of 1/4th of the physical memory or 1GB. Before J2SE 5.0, the default maximum heap size was 64MB.
Note: The boundaries and fractions given for the heap size are correct for J2SE 5.0. They are likely to be different in subsequent releases as computers get more powerful.