I'm trying to diagnose a memory issue in my Android app. I dumped an HPROF file and have it loaded up in the Eclipse MAT tool (see How to analyze memory using android studio). I'm now trying to make sense of the listed "Leak Suspects"

我试图在我的Android应用程序中诊断一个内存问题,我抛弃了一个HPROF文件,并将它加载到Eclipse MAT工具中(参见如何使用Android studio分析内存)。我现在要讲的是"泄漏嫌疑人"

I'm wondering if the following is indicative of a real problem:

我想知道以下是否反映了一个真正的问题:

23 instances of "byte[]", loaded by "<system class loader>" occupy 5,504,576 (12.74%) bytes.

Biggest instances:

byte[1077600] @ 0x43c523e0 rM!.rM!.tO#.wR&.zU).}X,..[/..]1..[/..[/..\0..\0..[/..Z...[/..\0..]7..]7..^8..^8..]7..\6.}Z4.}Z4.|Z4.|Z4.{Y3.zX2.zX2.zX2.zX2.{Y3.xX2.wW1.vV0.uU/.tS0.sR/.qS/.qS/.qS/.oQ-.oQ/.pR0.pS1.pS1.oR0.mP..sN1.sN1.sN1.rM0.sO/.sO/.uN/.uN/.xO/.xO/.xP-.wO,.yN+.yN+.{P-.|Q..... - 1,077,616 (2.49%) bytes.
byte[960000] @ 0x4383ef88 ................................................................................................................l.y.n.{.}...........................................l}s............................................................................................ - 960,016 (2.22%) bytes.
byte[563200] @ 0x42bd8c40 7@/. )..!*..)0 .'...!(..#'..04%.15'./6&.3;&.DL5.NX@.AJ5.0;*.1<,.AN<.6C1.0;*.-6%.*1!./3$.24&./0".+3../7 .6:).=A3.YZT.hhf._]`.caf.STV.[]\.GLH.@E?.KQG.JRE.BJ;.9B1.04..9C .=J..7H..>L2.RZO.[`\.[[Y.ceb.fhe.ikh.gif.bda._a^.ac`.egd.ad].^aZ.[^W.[^W.\_X.\_X.Z]V.WZS.... - 563,216 (1.30%) bytes.
byte[563200] @ 0x42c69660 46+.)+ .%'..%&.."#..#$..&'!.%& .%'..')..)+ .+-".,.#.+-".)+ .(*..,.#.+-".*,!.*,!.)+ .)+ .*,!.*,!.)+ .(*..(*..)+ .,.#..0%./1&./1&.,-%.*+#.()!.'( .'( .'( .&'..$%..&&..&&..&&..&&..&&..&&..&&..&&..'&!.'&!.'&!.'&!.'&!.'&!.'&!.'&!.** .++!...$.11%.33'.34&.23%.23%.... - 563,216 (1.30%) bytes.
byte[563200] @ 0x42cf7310 ---................................................................................................................................................................................................................................................................ - 563,216 (1.30%) bytes.
byte[563200] @ 0x42d85fe8 ................................................................................................................................................................................................................................................................... - 563,216 (1.30%) bytes.
byte[563200] @ 0x42e13f10 ..................................................................................................................................................................}...}...}...}...|...|...|...|...{...{...{...{...{...{...{...{...{...{...{...{...{...{...{...{.... - 563,216 (1.30%) bytes.

If so, how would you suggest tracking it down? If it's not, do you know what this byte data might be?

如果是的话,你建议如何追踪它?如果不是,你知道这个字节数据是什么吗?

1 个解决方案

#1


3

The problem with heapdumps is that you really need to know what is normal and abnormal with regards to the behaviour of your application. The "Leak Suspects" could give you an indicator, but it might also put you on the wrong foot.

heapdump的问题是,您确实需要知道应用程序的行为的正常和异常。“泄漏嫌疑人”可以给你一个指示,但它也可能会让你走上错误的道路。

To figure out if the sizes of the byte arrays are the problem you could check their path to the GC root. That will at least tell you where the byte arrays have been created.

要弄清楚字节数组的大小是否是问题,您可以检查它们的路径到GC根。这至少会告诉您字节数组已经创建的位置。

While using MAT I personally always look at the dominator tree. It should show you the biggest objects. You can from there also group by class loader, etc.

在使用MAT的时候,我个人总是看着主控树。它应该显示最大的对象。你也可以通过类装入器来分组,等等。

That should give you some more insights.

这应该会给你一些启发。

更多相关文章

  1. Android 在资源文件(res/strings.xml)定义一维数组,间接定义二维数
  2. 网路搜集:java整型数与网络字节序的 byte[] 数组转换关系
  3. JavaScript unshift()函数移入数据到数组第一位
  4. java数组和c中数组的区别
  5. java中 16进制字符串 与普通字符串 与 byte数组 之间的转化
  6. Java 数组练习题(1)
  7. Java数组的运用
  8. Java,从数组中查找Kth最大值[重复]
  9. java-IO流3(缓冲输入字节流)

随机推荐

  1. php八大数据类型有哪些
  2. php的优势与缺点
  3. php怎么接入公众号
  4. php依赖注入的三种方式
  5. php如何获取上传文件大小
  6. php怎么换行输出
  7. php中定义常量的两种方法
  8. php怎么跟数据库连接
  9. 使用PHP多维数组重组方法,兼容API接口
  10. php 字符串替换方法