Hitachi

uCosminexus Application Server Maintenance and Migration Guide


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:

(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.

Figure 9‒6: Instance structure (reference-related information output functionality)

[Figure]

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.

Figure 9‒7: Output result (reference-related information output functionality)

[Figure]

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.