Hitachi

uCosminexus Application Server Maintenance and Migration Guide


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

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

Figure 9‒8: Structure of the instances (static field-based reference relationship output functionality)

[Figure]

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.

Figure 9‒9: Output result (static field-based reference relationship output functionality)

[Figure]