9.5.2 Class-wise statistical information output by the STATIC member statistical functionality
This subsection describes about the output format, the output items, and the output examples of the class-wise statistical information output by the STATIC member statistical functionality.
- Organization of this subsection
(1) Output format and output items
The output format of the class-wise statistical information output by the STATIC member statistical functionality is as follows:
-
Output format
Java Heap Dump Static Profile ----------------------- ________________Size__Instances__Class________________ <total_size> <Instance_count> <class_name> <total_size> <Instance_count> <class_name> ...
-
Output items
The items listed in the output format are described as follows.
Table 9‒8: Output items (STATIC member statistical functionality) Output items
Meaning
<total_size>
The total size of the instance is output in byte unit.
<Instance_count>
The number of instance is output.
<class_name>
The class name is output.
(2) Output examples
The output example of the class-wise statistical information output by the STATIC member statistical functionality, is described as an example of the following source:
public class static_instance { public static void main(String args[]) { classA cls_a; classB cls_b; classC cls_c; cls_a = new classA(); cls_b = new classB(); cls_c = new classC(); cls_b.cls_c = cls_c; cls_a.cls_b = cls_b; try { Thread.sleep(20000); } catch (Exception e) {} } } class classA { static classB cls_b; } class classB { classC cls_c; } class classC { }
The following figure shows the output result of the STATIC member statistical functionality.
Moreover, there is a difference in the reference relation for the above source in the instance statistical functionality and in the STATIC member statistical functionality and the following figure shows this difference.
The reference relation of the respective functionality is as follows:
-
Reference relation of the instance statistical functionality
Instance variable cls_b of Instance A ->Instance variable cls_c of instance B -> Instance C
-
Reference relation of the STATIC member statistical functionality
Class variable cls_b of class A ->Instance variable cls_c of instance B -> Instance C