Sun GC Popup

Take a question about Sun GC. A FAQ on using Sun (old for 1.4.2) says that the bandwidth collector does not use the MaxTenuringThreshold (MTT) parameter. It is used only for CMS. http://java.sun.com/docs/hotspot/gc1.4.2/faq.html

(12) What if my application has medium or long-lived objects?

  • Objects that survive in the collection of the young generation have the cost of copying (part of the algorithm for the collection of the young generation is copying any objects that survive). Medium or long-lived objects can be copied several times. Use the -XX MaxTenuringThreshold option to determine the cost of copying. Use -XX: MaxTenuringThreshold = 0 to transfer an object that immediately survived into the younger generation's collection to generation. If this improves application performance, copying long-lived objects is significant. Note that the bandwidth collector does not use the MaxTenuringThreshold parameter .

I do not know how to check this, but if it is true, how does the bandwidth collector determine when to promote young objects in a generation? This is done every time the younger generation is full (in other words, MTT = 0?).

+3
source share
2 answers

If you are talking about the modern (1.6.0) Sun GC, you can download the source code and independently develop for yourself what is happening. But of course, behavior can vary with different levels of patches.

Here are some recent documents that relate to the -XXmaxTenuringThreshold option:

Google. .

0

OpenJDK 1.6 psScavenge.cpp (= -XX:+UseParallelGC= ),

if (AlwaysTenure) {
    _tenuring_threshold = 0;
} else if (NeverTenure) {
    _tenuring_threshold = markOopDesc::max_age + 1;
} else {
    // We want to smooth out our startup times for the AdaptiveSizePolicy
    _tenuring_threshold = (UseAdaptiveSizePolicy) ? InitialTenuringThreshold :
                                                MaxTenuringThreshold;
}

(OpenJDK 1.6) MaxTenuringThreshold -XX:+UseAdaptiveSizePolicy. 7.

IMHO, , , , JDK 1.4.2 / , , .

, -XX:+PrintTenuringDistribution

 Desired survivor size 48286924 bytes, new threshold 10 (max 10)
 - age   1:   28992024 bytes,   28992024 total
 - age   2:    1366864 bytes,   30358888 total
 - age   3:    1425912 bytes,   31784800 total
0

Source: https://habr.com/ru/post/1758466/


All Articles