java jmap直方图中的这些对象是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7913759/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 21:59:32  来源:igfitidea点击:

What are these objects in the jmap histogram?

javamemoryjmap

提问by Chris Steinbach

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 来获取堆的直方图。我不确定被称为“[C”、“[S”、“[I”和“[B”的对象是什么。有人知道吗?

$ 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

回答by Joachim Sauer

  • [Cis a char[]
  • [Sis a short[]
  • [Iis a int[]
  • [Bis a byte[]
  • [[Iis a int[][]
  • [C是一个 char[]
  • [S是一个 short[]
  • [I是一个 int[]
  • [B是一个 byte[]
  • [[I是一个 int[][]

The JavaDoc for Class.getName()has the details.

JavaDoc forClass.getName()有详细信息。