'Memory dump an app in android
I'm on a rooted device and want to take a complete memory dump of a certain app.
I've tried:
- Some google results say to use "adb kill -10 [pid]" But, it is giving me "sigusr1 forcing gc (no hprof)", and no hproc is dumped. This could be device specific.
- I've also tried using "Dump PROF file" button in DDMS (Eclipse), but it only gives me a file that is about 5 MB, this is not a complete memory dump and not very useful.
- I've tried to chmod /proc/[pid]/mem, and access that file, but even on a rooted device, it is giving me permission denied.
Solution 1:[1]
HPROF is a dump of heap alone, so it is obviously not all memory. As explained here, Android no longer dumps heap on SIGUSR1 (signal 10) in newer versions. Some useful facts on using /proc/[pid]/mem are given here. In short: your "permission denied" may as well be caused by trying to read the file in wrong way.
EDIT: to read anything, other than /proc/self/mem having debug permissions may be extra useful, see this question for some insights.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
