抓取HPROF log

1. GUI

可以通过 adt-bundle-windows-x86_64-20140702\sdk\tools\monitor.bat来抓取。

打开软件,选中相应的包,比如“com.android.mms”,然后点击"Dump HPROF file" 按钮,保存为 “mms_0810.hprof" 即可。

2.通过代码

在编写代码的时候,如果想保存HPROF文件,使用android.os.Debug.dumpHprofData()函数即可。

   xxxButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
android.os.Debug.dumpHprofData("/sdcard/com.android.mms.hprof");
}
}

3.命令行

adb shell am dumpheap com.android.mms /data/mms_0810.hprof

关于dumpheap 的使用方法,可以参考下面。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu8AAAB0CAIAAAC630uvAAAgAElEQVR4nO2d32sbSdrv87fURWF0YYEFsxiPncGLwAKPX9DM4vCOMMqFZyJYE+wY7eIMWfHGgfW7YjEkXixmJh6OF+LxGo4m8fzw8RrNhMwrzsYGG4ECsWM0DsignrN90QN1ey6qu1TdXdX6YTu2nO+HYYja1VXP81Sr66uqp7qvMACAhlevXp23CQAAABpz5bwNAODiAjUDAAAdAdQMAFqgZgAAoCOAmgFAC9QMAAB0BFAzAGiBmgEAgI4AagYALZ2lZkrZKEnl39x5p0d1Y2aom5JztgIA0MFccjVz5eMr/L9CuXDetqgZeTDCLZxenT5vW4CXZtVMPkUcaPfAhzNrL60ztkxFp6oZa2MqTD+4XzZN0zw/Ky4Y1e0nT7ar520FAJ1DU2qm605X152ukzdWKBfe8LB9Fm2NPBg5i2pbqnPkwQhz4in+4weZpOHkg0xSTrK2m16dljWfp84rH9evEPmgqMF/cHp1ug3tqPToysdXFguLjLHFwqI4Ii5FuQBHZ3x7JrHW1EwqzxizjNc7j2dHIzSW3X0jgka0zDpXzZSyUTK+Fhiuy3fBN+L7yRAdfVhhzN3HjSlloySaLbXRpHDEExB+a/IEip/SdafLf0v3nM7rXCwsyl9VAE6dZudmTkXNMMYWC4sdpGYupqkjD0bEfUGOpzjuOSjuufLdX5wuerZQLvCz5NPFPUjUw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0/tD/mBhJBwOh6c2nAzZ5QTlGROMmYebs2O//8fPrqY1DqjP0xjUnINBasbaSjs5LFzN2HJI9tQqZvp5xo3FLGNv6cbYX57/W2fTGeXNNOzrF/MxrgWM4/JPf6snsajP1ZV+PivlzWRi1D6u7pTm8mYUrasDGuABvZr++tBklrG3lIzYeTPKLxK4LEDNAKDlDasZngV85eMrhXJh5MHIlY+vjDwYYQF7mhy8T89zHg9LaPfQZOo/WlUz16bEjpKx3K7397Bu+aW6MWPvIRkYuzs1In6DV/OTfSHCs1M8yxIHCyOuKQdmllfEDpUB/3YjrQPK89QGNedg8EqTvJGmvtLk8pRZRwWxe8ne+KQPkmtbkH5Pk9hHVd9QdLKVJuc6CfUMz/xp3Jkh0q00qUv7jHdCpu5MsTMp1Kff06SyXBlQvQeD42lnL9rQzAbvocrDURqa/N4XLHApgJoBQMtFfnreGaGc/L9MXHoH3zyWJQRhbTlxER7mh0SZtxGoGQC0QM1cPi69g2+aFw/e/01yaU/sV78Ij3CEmnkbgZoBQAvUzOXj0jv4xlE91++cgZp5G4GaAUDLW6hmAACgE/n/qbuNL38araMAAAAASUVORK5CYII=" alt="" />

另外,查找一个JAVA使用的命令行工具。

http://docs.oracle.com/cd/E19798-01/821-1752/beafo/index.html

#java -Xrunhprof:help

     HPROF: Heap and CPU Profiling Agent (JVMTI Demonstration Code)

hprof usage: java -agentlib:hprof=[help]|[<option>=<value>, ...]

Option Name and Value  Description                    Default
--------------------- ----------- -------
heap=dump|sites|all heap profiling all
cpu=samples|times|old CPU usage off
monitor=y|n monitor contention n
format=a|b text(txt) or binary output a
file=<file> write data to file java.hprof[{.txt}]
net=<host>:<port> send data over a socket off
depth=<size> stack trace depth
interval=<ms> sample interval in ms
cutoff=<value> output cutoff point 0.0001
lineno=y|n line number in traces? y
thread=y|n thread in traces? n
doe=y|n dump on exit? y
msa=y|n Solaris micro state accounting n
force=y|n force output to <file> y
verbose=y|n print messages about dumps y Obsolete Options
----------------
gc_okay=y|n Examples
--------
- Get sample cpu information every millisec, with a stack depth of :
java -agentlib:hprof=cpu=samples,interval=,depth= classname
- Get heap usage information based on the allocation sites:
java -agentlib:hprof=heap=sites classname

转化HPROF log

使用adt-bundle-windows-x86_64-20140702\sdk\platform-tools\hprof-conv.exe来转化。

hprof-conv a.hprof b.hprof

MAT分析

http://www.ibm.com/developerworks/cn/opensource/os-cn-ecl-ma/index.html

05-02 00:22