What are these objects in the jmap histogram?

Chris Steinbach picture Chris Steinbach · Oct 27, 2011 · Viewed 17k times · Source

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

Answer

Joachim Sauer picture Joachim Sauer · Oct 27, 2011
  • [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.