9.6.2 Class-wise statistical information output by the reference-related information output functionality
This subsection describes about the output format, the output items, and the output examples of the class-wise statistical information output by the reference-related information output functionality.
- Organization of this subsection
(1) Output format and output items
The output format of the class-wise statistical information output by the reference-related information output functionality is as follows:
-
Output format
Reference of class option-specified-class-name --------------------------------------------# class-name(address)[area-name] class-name(address)[area-name] option-specified-class-name(address)[area-name] ------ class-name(address)[area-name] java.lang.ref.Finalizerrepetition-count times class-name(address)[area-name] class-name(address)[area-name] option-specified-class-name(address)[area-name] ------ ...
- #
-
'-(hyphen)' for the number in which 19 is added is output to the string length of the option-specified-class-name.
-
Output items
The each items listed in the output format are described as follows:
Table 9‒10: Output items (reference-related information output functionality) Output items
Meaning
class-name
The class name to be referenced by an instance of the class that is specified in the -class option of the jheapprof command is output.
address
The address of the instance is output.
area-name
The area where instance belongs is output.
-
Eden: Indicates Eden area.
-
Survivor: Indicates Survivor area.
-
Tenured: Indicates Tenured area.
-
EM(eid=<id>): Indicates Explicit memory block.
option-specified-class-name
The class name specified in the -class option of the jheapprof command is output.
java.lang.ref.Finalizer
The object of java.lang.ref.Finalizer created in the class having the finalize() method is output all together.
repetition-count
The count where the reference of the Finalizer instance is continuous is output.
-
(2) Example of output
The output example of the class-wise statistical information output by the reference-related information output functionality, is described as the example of the following source:
public class instance2 { public static void main(String args[]) { classA cls_a1 = new classA(); classA cls_a2 = new classA(); classB cls_b1 = new classB(); classB cls_b2 = new classB(); classC cls_c1 = new classC(); classC cls_c2 = new classC(); classC cls_c3 = new classC(); classC cls_c4 = new classC(); cls_a1.cls_a = cls_a2; cls_a1.cls_b = cls_b1; cls_a1.cls_c = cls_c1; cls_a2.cls_b = cls_b2; cls_b1.cls_c = cls_c2; cls_b2.cls_c = cls_c3; cls_c1.cls_c = cls_c4; try { Thread.sleep(20000); } catch (Exception e) {} } } class classA { classA cls_a; classB cls_b; classC cls_c; classA() { classB cls_b; } } class classB { classC cls_c; } class classC { classC cls_c; }
The following figure shows the instance structure.
|
The following figure shows the output result of the reference-related information output functionality. In such case, specify an argument -class class-name in the jheapprof command, and then execute the command.
|
The address of all class A has same addresses (0x10766840). Therefore, it is understood that instances of all class A are same. On the other hand, the class B in (1) and (4) has different address and therefore, has different instances.
Note that the placement for the instances on the memory is changed due to the GC occurrence. Therefore, whenever the address and the area name is output, they might change every time.