Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

1312255201
Copy link

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相反

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant