9.6.3 Class-wise statistical information output by the static field-based reference relationship output functionality
This subsection describes the output format, output items, and examples of output of the class-wise statistical information output by the static field-based reference relationship output functionality.
- Organization of this subsection
(1) Output format and output items
-
Output format
The output format of the class-wise statistical information output by the static field-based reference relationship output functionality is as follows:
Reference of class option-specified-class-name from static field -------------------------------------------------------------#1 static field static-field-declaring-class-name#2.static-field-name#2 class-name(address)[area-name] class-name(address)[area-name] option-specified-class-name(address)[area-name] ------ ...- #1:
-
The number of "-" (hyphens) that are output is equal to 37 added to the number of characters in option-specified-class-name.
- #2:
-
Indicates the base of the reference relationship.
-
Output items
The following table describes the items shown in the output format.
Table 9‒11: Output items (static field-based reference relationship output functionality) Output items
Meaning
static-field-declaring-class-name
The class name declaring the static field that forms the base is output.
static-field-name
The name of the static field that forms the base is output.
class-name
The class name of the instance that references the instances of the classes specified in the -class option of the jheapprof command is output.
address
The address of the instance is output.
area-name
The area to which the instance belongs is output.
-
Eden: Indicates the Eden area.
-
Survivor: Indicates the Survivor area.
-
Tenured: Indicates the Tenured area.
-
EM(eid=<id>): Indicates the Explicit memory block.
option-specified-class-name
The class name specified in the -class option of the jheapprof command is output.
-
(2) Examples of output
This subsection gives an example output of the class-wise statistical information output by the static field-based reference relationship output functionality using the following source as an example:
import JP.co.Hitachi.soft.jvm.MemoryArea.*;
public class static_reference {
public static void main(String args[]) {
try {
classA cls_a1 = 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();
BasicExplicitMemory emem = new BasicExplicitMemory();
classC cls_c4 = (classC)emem.newInstance(classC.class);
cls_a1.s_cls_a = cls_a1;
cls_a1.s_cls_b = cls_b1;
cls_a1.s_cls_c = cls_c1;
cls_a1.cls_b = cls_b2;
cls_b1.cls_c = cls_c2;
cls_b2.cls_c = cls_c3;
cls_c1.cls_c = cls_c4;
Thread.sleep(20000);
} catch (Exception e) {e.printStackTrace();}
}
}
class classA {
static classA s_cls_a;
static classB s_cls_b;
static classC s_cls_c;
classB cls_b;
}
class classB {
classC cls_c;
}
class classC {
classC cls_c;
public classC(){
}
}The following figure shows the structure of the instances.
|
|
The following figure shows the output result of the static field-based reference relationship output functionality. In this case, the jheapprof command is executed specifying the argument -class class-name -staticroot.
|
|