Skip to content

fix: 修正一处文档错误#2662

Merged
Snailclimb merged 1 commit intoSnailclimb:mainfrom
1312255201:patch-1
Apr 24, 2025
Merged

fix: 修正一处文档错误#2662
Snailclimb merged 1 commit intoSnailclimb:mainfrom
1312255201:patch-1

Conversation

@1312255201
Copy link
Copy Markdown
Contributor

https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/jvm/jvm-parameters-intro.md
的-XX:NewRatio参数,通过查阅oracle的文档
文档原文地址
https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/sizing.html
文档原文

The Young Generation
After total available memory, the second most influential factor affecting garbage collection performance is the proportion of the heap dedicated to the young generation. The bigger the young generation, the less often minor collections occur. However, for a bounded heap size, a larger young generation implies a smaller tenured generation, which will increase the frequency of major collections. The optimal choice depends on the lifetime distribution of the objects allocated by the application.

By default, the young generation size is controlled by the parameter . For example, setting means that the ratio between the young and tenured generation is 1:3. In other words, the combined size of the eden and survivor spaces will be one-fourth of the total heap size.NewRatio-XX:NewRatio=3

The parameters and bound the young generation size from below and above. Setting these to the same value fixes the young generation, just as setting and to the same value fixes the total heap size. This is useful for tuning the young generation at a finer granularity than the integral multiples allowed by .NewSizeMaxNewSize-Xms-XmxNewRatio

中文对照:

默认情况下,新生代的大小由参数-XX:NewRatio控制。例如,设置-XX:NewRatio=3表示新生代与老年代的比例为1:3。换句话说,Eden区和Survivor区的总大小将是整个堆内存的四分之一。

也就是这里设置2 应该为 新的占1老的占2,与原来表述的新的占2/3相反

@Snailclimb
Copy link
Copy Markdown
Owner

https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/jvm/jvm-parameters-intro.md 的-XX:NewRatio参数,通过查阅oracle的文档 文档原文地址 https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/sizing.html 文档原文

The Young Generation
After total available memory, the second most influential factor affecting garbage collection performance is the proportion of the heap dedicated to the young generation. The bigger the young generation, the less often minor collections occur. However, for a bounded heap size, a larger young generation implies a smaller tenured generation, which will increase the frequency of major collections. The optimal choice depends on the lifetime distribution of the objects allocated by the application.

By default, the young generation size is controlled by the parameter . For example, setting means that the ratio between the young and tenured generation is 1:3. In other words, the combined size of the eden and survivor spaces will be one-fourth of the total heap size.NewRatio-XX:NewRatio=3

The parameters and bound the young generation size from below and above. Setting these to the same value fixes the young generation, just as setting and to the same value fixes the total heap size. This is useful for tuning the young generation at a finer granularity than the integral multiples allowed by .NewSizeMaxNewSize-Xms-XmxNewRatio

中文对照:

默认情况下,新生代的大小由参数-XX:NewRatio控制。例如,设置-XX:NewRatio=3表示新生代与老年代的比例为1:3。换句话说,Eden区和Survivor区的总大小将是整个堆内存的四分之一。

也就是这里设置2 应该为 新的占1老的占2,与原来表述的新的占2/3相反

感谢指出,当时翻译的时候没注意到。

@Snailclimb Snailclimb merged commit 153c81c into Snailclimb:main Apr 24, 2025
@Snailclimb
Copy link
Copy Markdown
Owner

https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/jvm/jvm-parameters-intro.md 的-XX:NewRatio参数,通过查阅oracle的文档 文档原文地址 https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/sizing.html 文档原文

The Young Generation
After total available memory, the second most influential factor affecting garbage collection performance is the proportion of the heap dedicated to the young generation. The bigger the young generation, the less often minor collections occur. However, for a bounded heap size, a larger young generation implies a smaller tenured generation, which will increase the frequency of major collections. The optimal choice depends on the lifetime distribution of the objects allocated by the application.

By default, the young generation size is controlled by the parameter . For example, setting means that the ratio between the young and tenured generation is 1:3. In other words, the combined size of the eden and survivor spaces will be one-fourth of the total heap size.NewRatio-XX:NewRatio=3

The parameters and bound the young generation size from below and above. Setting these to the same value fixes the young generation, just as setting and to the same value fixes the total heap size. This is useful for tuning the young generation at a finer granularity than the integral multiples allowed by .NewSizeMaxNewSize-Xms-XmxNewRatio

中文对照:

默认情况下,新生代的大小由参数-XX:NewRatio控制。例如,设置-XX:NewRatio=3表示新生代与老年代的比例为1:3。换句话说,Eden区和Survivor区的总大小将是整个堆内存的四分之一。

也就是这里设置2 应该为 新的占1老的占2,与原来表述的新的占2/3相反

我对这篇JVM参数总结进行了优化改进:2e7aa2a

@Snailclimb Snailclimb added the doc-bug Content error label Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-bug Content error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants