Java Reference
In-Depth Information
aptive sizing is also useful for applications that go through markedly different phases, if you
want to optimally tune GC for one of those phases.
At a global level, adaptive sizing is disabled by turning off the -XX:-UseAdaptiveS-
izePolicy flag (which is true by default). With the exception of the survivor spaces (which
are examined in detail in the next chapter), adaptive sizing is also effectively turned off if the
minimum and maximum heap sizes are set to the same value, and the initial and maximum
sizes of the new generation are set to the same value.
To see how the JVM is resizing the spaces in an application, set the -
XX:+PrintAdaptiveSizePolicy flag. When a GC is performed, the GC log will contain in-
formation detailing how the various generations were resized during a collection.
QUICK SUMMARY
1. Adaptive sizing controls how the JVM alters the ratio of young generation to old
generation within the heap.
2. Adaptive sizing should generally be kept enabled, since adjusting those generation
sizes is how GC algorithms attempt to meet their pause time goals.
3. For finely tuned heaps, adaptive sizing can be disabled for a small performance
boost.
GC Tools
Since GC is central to the performance of Java, there are many tools that monitor its per-
formance.
The best way to see what effect GC has on the performance of an application is to become
familiar with the GC log, which is a record of every GC operation during the program's exe-
cution.
The details in the GC log vary depending on the GC algorithm, but the basic management of
the log is always the same. That management is covered here, and more details on the con-
tents of the log are given in the algorithm-specific tuning sections in the next chapter.
Search WWH ::




Custom Search