9.8.3 Notes for executing the unused objects statistical functionality in the Tenured area
This subsection describes the notes for executing the unused objects statistical functionality in the Tenured area.
- Organization of this subsection
(1) Notes when the unused objects statistical functionality in the Tenured area is executed immediately after a Full GC
If you execute the unused objects statistical functionality in the Tenured area immediately after a Full GC, the statistical processing is executed when the unused objects in the Tenured area for which the statistics are to be collected have been collected. Therefore, the total instance size within the class-wise statistical information and the number of instances becomes less, and the unused objects cannot be identified effectively. To effectively identify the unused objects, execute the unused objects statistical functionality in the Tenured area. The following describes the execution of the unused objects statistical functionality in the Tenured area separately for the case where the timing of occurrence of a Full GC is known and for the case where it is not known.
(a) When the timing of occurrence of a Full GC is known
If you execute the unused objects statistical functionality in the Tenured area immediately before a Full GC, the statistical processing is executed when the number of unused objects in the Tenured area for which the statistics are to be collected is large. Therefore, the total instance size within the class-wise statistical information and the number of instances becomes large, and the unused objects can be identified effectively.
(b) When the timing of occurrence of a Full GC is not known
To increase the total instance size within the class-wise statistical information, the number of instances, and effectively identify the unused objects:
-
To know the timing of occurrence of Full GC, set the -XX:+HitachiVerboseGC option to output the extended verbosegc information at JavaVM startup. By specifying the option, you can acquire the GC information.
-
Execute the unused objects statistical functionality in the Tenured area at a fixed interval in JavaVM. As a result, you can acquire the GC information and multiple class-wise statistical information.
-
You can acquire the date and time of a Full GC from the extended verbosegc information, so select the class-wise statistical information that is close to the Full GC. The class-wise statistical information close to the Full GC is information about the statistical processing executed when the number of unused objects in the Tenured area for which statistics are to be collected is large.
(2) Notes on statistical results
The following is an example of reference relationship showing the notes on statistical results.
|
In this figure, when you assume a1 as the lowest address, the statistical processing is executed with the reference relationship a1→ b1→ c1 in which a1 is the base object. At this point, if you assume b1 or c1 as the base object, expected results will not be output to the statistical results of the unused objects statistical functionality in the Tenured area and the base object list output functionality for Tenured augmentation factors.
(3) Notes on objects for which the statistics are not to be collected
The following figure shows the objects for which the statistics are not to be collected for a case in which the objects (a1 and c1) of the Tenured area have a reference relationship with the object (b1) of other than the Tenured area.
|
In this figure, the statistics are not collected for the object (b1) that belongs to other than the Tenured area. However, the size of the referenced object (c1) of the Tenured area is added to the total instance size of the class B.
(4) Notes for reference relationship from multiple objects
The following figure shows a reference relationship from multiple objects for a case having a reference relationship in which one object (b1) is referenced from multiple reference sources (c1 and d1).
|
In this figure, if you execute the unused objects statistical functionality in the Tenured area, the statistical processing is executed from the base object having the lowest address among the base objects (c1 and a1) of the reference relationship to which the reference source belongs. Therefore, if a1 is the object with the lowest address and c1 is the base object, the expected results will not be output in the statistical results of the unused objects statistical functionality in the Tenured area and the base object list output functionality for Tenured augmentation factors.
(5) Notes for increasing the statistical value
If executing the unused objects statistical functionality in the Tenured area and the base object list output functionality for Tenured augmentation factors in a Java process in which the -XX:+HitachiAutoExplicitMemory option is specified, the following phenomena occurs:
-
In the class-wise statistical information output by the unused objects statistical functionality in the Tenured area, the total instance size of the float type array type (information in which [F is output in the class name) and the statistical value of the number of instances becomes larger than the original statistical value. An output example of the class-wise statistical information is as follows:
Garbage Profile --------------- ________________Size__Instances__Class________________ 43861400 473859 [F 0 0 java.util.Collections$EmptyMap 0 0 sun.security.util.Debug 0 0 java.nio.ByteOrder
-
If you output a float type array type (information in which [F is output in the class name) in the base object list that is output by the base object list output functionality for Tenured augmentation factors, the total statistical value of the instance size becomes larger than the original statistical value. An output example of the base object list for Tenured augmentation factors is as follows:
Garbage Profile Root Object Information --------------------------------------- *, [F # 43861400
If you are using versions earlier than 08-70, specify the -XX:-HitachiExplicitMemoryPartialTenuredAreaCollection option to prevent occurrence of this phenomenon.