I am using the command "jmap -histo pid" and want to know what it is exactly telling me.
The output is something like:
num #instances #bytes class name
----------------------------------------------
1: 2284437 262114728 [C
2: 686409 124390432 [B
3: 363878 46799288 <constMethodKlass>
4: 363878 46590464 <methodKlass>
5: 1817209 43613016 java.lang.String
6: 34590 37296528 <constantPoolKlass>
7: 296302 36673344 [I
8: 34585 33237656 <instanceKlassKlass>
9: 248731 21559504 [Ljava.lang.Object;
10: 28200 19991872 <constantPoolCacheKlass>
11: 563323 13519752 scala.collection.immutable.$colon$colon
12: 26813 13103488 <methodDataKlass>
13: 506968 12167232 scala.collection.immutable.HashSet$HashSet1
14: 200750 10371320 [Lscala.collection.immutable.HashSet;
15: 114268 9477096 [Lscala.collection.immutable.HashMap;
16: 92405 7392400 java.lang.reflect.Method
17: 200953 6430496 scala.collection.immutable.HashMap$HashMap1
By example: What's "bytes" exactly displaying?
Maybe someone can explain to me what's "#instances" aswell.
This is the summary of current Java Heap contents grouped by the object class.
#instances
is the total number of objects of the given class (both reachable and unreachable) in Java Heap;#bytes
is the total shallow size of objects of the given class currently residing in Java Heap (i.e. how much memory they use, but not how much memory is used by objects they reference)#bytes / #instances
will be the average size of an object of the given class.