JVM (3) -MAT: histogram histogram

1, the histogram histogram

 

 

                                            figure 1

 

2, deep and shallow heap stack (from the Geyi Ming "java Performance Tuning")

Shallow pile (Shallow Heap) and deep-pile (Retained Heap) are two very important concepts, which represent the structure of an object and the size of the memory occupied by an object to be recovered GC, can release the real memory size.

Shallow stack (Shallow Heap) refers to a target memory consumption. In the 32-bit system, a reference to the object takes up four bytes, an int occupies four bytes, long type will occupy 8 bytes, each object needs to occupy the first 8 bytes.

 

FIG 2, String class structure (String.java -> Right -> Show Diagrams-> selected from the display field f)

 

Reserved Set (Retained Set): Reserved Set object A refers to all the objects in the collection after the current object A is garbage, will be released (including the object A itself), that is set to retain the object A can be considered only by the object A It is set directly or indirectly accessible to all objects. In layman's terms, it refers to a collection of objects A held object.

Deep stack (Retained Heap) : reservations subject shallow focus heap size of all the objects and.

Note: refers to the shallow heap memory occupied by the object itself, not including the size of its internal reference object. Refers to an object stack depth can only be accessed through the object to (directly or indirectly) all of the objects and the light stack, i.e., the object is recovered, the real space can be released.

3, reference relationships between objects

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Published 20 original articles · won praise 2 · views 40000 +

Guess you like

Origin blog.csdn.net/jji8877032/article/details/84496682