Garbage Collection Data of Interest
The data of interest in garbage colleciton statistics are
- The garbage collector in use
- The size of the Java heap
- The size of the young generation and old generation spaces
- The size of the permanent generation space
- The duration of the minor garbage collecitons
- The frequency of minor garbage collecitons
- The amount of space reclaimed in minor garbage collecitons
- The duration of full garbage collecitons
- The frequency of full garbage collecitons
- The amount of space reclaimed in a concurrent garbage colleciton cycle
- The occupancy of the Java heap before and after garbage collecitons
- The occupancy of the young generation and old generation space before and after garbage colleciotns
- The occupancy of the permanent generation space before and after garbage colleciton
- Whether it is the occupancy of the old generation space or the occupancy of the permannet generation space that triggers a full garbage collection
- Whether the applicaiton is making use of explicit calls to System.gc()
- -
Garbage Collection Reporting
There is little additional overhead in the HotSpot Vm to report garbage colleciton data. In fact, the overhead is so small it is recommended to collect garbage colleciton data in production environments. This seciton describes several different HotSpot VM command line options that produce garbage collection statistics along with an explanation of the statistics.
There are generally two different types of garbage collections : a minor garbage collection, also called a young generation garbage collection, and a full garbage collection, also called a major garbage collection. A minor garbage colleciton collects the young generation space. A full garbage collection generally expresses the notion of garbage collecting and compacting the old generation and permanent generation spaces.