有一个关于 Sun GC 的问题。 Sun FAQ(1.4.2 的旧版)指出吞吐量收集器不使用 MaxTenuringThreshold (MTT) 参数。它仅用于 CMS。 http://java.sun.com/docs/hotspot/gc1.4.2/faq.html
(12) What should I do if my application has mid- or long-lived objects?
- Objects that survive a young generation collection have a copying cost (part of the algorithm for a young generation collection is to copy any objects that survive). Mid- or long-lived objects may be copied multiple times. Use the -XX option MaxTenuringThreshold to determine the copying costs. Use -XX:MaxTenuringThreshold=0 to move an object that survives a young generation collection immediately to the tenured generation. If that improves the performance of the application, the copying of long-lived objects is significant. Note that the throughput collector does not use the MaxTenuringThreshold parameter.
我不知道如何验证这一点,但如果这是真的,吞吐量收集器如何确定何时将年轻对象提升为终身代?是每次年轻代填满时就执行此操作吗(换句话说 MTT = 0 ?)。
最佳答案
如果您谈论的是现代 (1.6.0) Sun GC,您可以下载源代码并自己弄清楚到底发生了什么。但当然,行为可能会随着补丁级别的不同而改变。
以下是一些引用 -XXmaxTenuringThreshold 选项的最新文档:
- Java Tuning White Paper - 孙(2005)
- "The most complete list of -XX options for Java 6 JVM" - 尤金·库列绍夫 (2006)
Google 搜索中会显示各种提示。但我在网上找不到任何明确的文档或你的问题的明确答案。
关于java - Sun GC 最大保留阈值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3427786/