3

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"

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?

4

1 回答 1

3

heapdumps 的问题是你真的需要知道关于你的应用程序行为的正常和异常。“泄漏嫌疑人”可以给你一个指标,但它也可能让你走错路。

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

在使用 MAT 时,我个人总是查看支配树。它应该向您展示最大的物体。您还可以从那里按类加载器等进行分组。

这应该会给你更多的见解。

于 2014-09-09T16:22:24.963 回答