I'm using jmap to get a histogram of the heap. I'm not sure what the objects are that are referred to as "[C", "[S", "[I" and "[B". Anyone know?
$ jmap -histo 3299
num #instances #bytes class name
----------------------------------------------
1: 9804 19070632 [Ljava.util.HashMap$Entry;
2: 38074 6216960 [Ljava.lang.Object;
3: 62256 4727832 [C
4: 19665 3124744 <constMethodKlass>
5: 19665 2365864 <methodKlass>
6: 57843 2313720 java.lang.String
7: 1662 2060528 <constantPoolKlass>
8: 21121 1842344 [S
9: 37772 1743888 <symbolKlass>
10: 2554 1655632 [I
11: 63710 1529040 java.lang.Integer
12: 1662 1264184 <instanceKlassKlass>
13: 1515 1196224 <constantPoolCacheKlass>
14: 24351 1168848 java.util.HashMap$Entry
15: 18706 1047536 java.net.SocketTimeoutException
16: 4301 784416 [B
...
23: 2588 242616 [[I
Depending on the parameter specified, the jmap -histo command can print out the heap histogram for a running process or a core file. When the command is executed on a running process, the tool prints the number of objects, memory size in bytes, and fully qualified class name for each class.
jmap is a tool to print statistics about memory in a running JVM. We can use it for local or remote processes. Along with that option, we should specify several parameters: live: if set, it only prints objects which have active references and discards the ones that are ready to be garbage collected.
jmap tool is shipped with JDK. Here is how you should invoke it: jmap -dump:live,file=<file-path> <pid> where pid: is the Java Process Id, whose heap dump should be captured file-path: is the file path where heap dump will be written in to. Note: It's quite important that you pass the “live” option in the command line.
[C
is a char[]
[S
is a short[]
[I
is a int[]
[B
is a byte[]
[[I
is a int[][]
The JavaDoc for Class.getName()
has the details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With