gpt4 book ai didi

java - 各种 Sun JVM 的默认最大堆大小是多少?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:03:34 26 4
gpt4 key购买 nike

人们会认为很容易找到一个表,其中列出了不同 JVM 版本的默认最大堆大小……但快速搜索并没有找到这样的东西。

那么,各种 Sun JVM 的默认最大堆大小是多少?

最佳答案

我完全理解您问题的重点,因为 JVM 默认值因供应商和版本而异。我也会对适当的矩阵感兴趣。但我只有Oracle Java 7 docs说:

The default value is chosen at runtime based on system configuration. For server deployments, -Xms and -Xmx are often set to the same value. For more information, see HotSpot Ergonomics

deeper inside the docs它说:

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.

关于java - 各种 Sun JVM 的默认最大堆大小是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3339468/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com