tree: df74c55db579e65b11f16637a8e0c706679c0bf6 [path history] [tgz]
  1. bookkeeping.cc
  2. bookkeeping.h
  3. bookkeeping_unittest.cc
  4. bounded_queue.h
  5. bounded_queue_unittest.cc
  6. BUILD.gn
  7. client.cc
  8. client.h
  9. client_unittest.cc
  10. heapprofd_integrationtest.cc
  11. main.cc
  12. README.md
  13. record_reader.cc
  14. record_reader.h
  15. record_reader_unittest.cc
  16. sampler.cc
  17. sampler.h
  18. sampler_unittest.cc
  19. socket_listener.cc
  20. socket_listener.h
  21. socket_listener_unittest.cc
  22. string_interner.cc
  23. string_interner.h
  24. string_interner_unittest.cc
  25. unwinding.cc
  26. unwinding.h
  27. unwinding_unittest.cc
  28. wire_protocol.cc
  29. wire_protocol.h
  30. wire_protocol_unittest.cc
src/profiling/memory/README.md

heapprofd - Android Heap Profiler

These are temporary instructions while heapprofd is under development. They are subject to frequent change and will be obsoleted once heapprofd is integrated into Perfetto.

Currently heapprofd only works with SELinux disabled and when run as root.

To start profiling the process ${PID}, run the following sequence of commands.

adb root
adb shell setenforce 0

adb shell rm /dev/socket/heapprofd
adb shell 'heapprofd -r 128000 /dev/socket/heapprofd' &
adb shell kill -36 ${PID}

To obtain heap dumps for all profiled processes, send SIGUSR1 to heapprofd which produces heap dumps in /data/local/tmp.

adb shell killall -USR1 heapprofd
adb pull /data/local/tmp/heap_dump.${PID}

This file can then be converted to a flamegraph using Brendan Gregg's flamegraph.pl.

flamegraph.pl heap_dump.${PID} > heap_dump.${PID}.svg