New issue
Advanced search Search tips

Issue 917475 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

apk_operations.py: Add java heap dump helpers

Project Member Reported by agrieve@chromium.org, Dec 21

Issue description

Performing a java heap dump is not that hard, but many don't know about it. This makes it a good candidate for inclusion in apk_operations.py. :)


To start heap dump: "adb shell am dumpheap org.chromium.chrome:privileged_process0 /data/local/tmp/TEMP.dump"
To wait for it to finish: check logcat for "heap dump completed"

To get stacks for allocation, can also add --track-allocation to the adb command within "launch".
* The default stack size is 16. May want to increase this via: setprop debug.allocTracker.stackDepth 50


Once the snapshot is pulled to local, would be good to split out a command that can be used to view it.

E.g. probably with either:
  https://android.googlesource.com/platform/art/+/master/tools/ahat/README.txt (prebuilt .jar available at go/ahat)

Or print a link to:
  https://developer.android.com/studio/profile/memory-profiler#import-hprof 

 
Components: Tools

Sign in to add a comment