Quickstart: Heap profiling
- A host running macOS or Linux.
- A device running Android 10+.
- A Profileable or Debuggable app. If you are running on a "user" build of Android (as opposed to "userdebug" or "eng"), your app needs to be marked as profileable or debuggable in its manifest. See the heapprofd documentation for more details.
tools/heap_profile (if you don't have a perfetto checkout) and
run it as follows:
curl -LO https://raw.githubusercontent.com/google/perfetto/master/tools/heap_profile chmod +x heap_profile ./heap_profile -n system_server Profiling active. Press Ctrl+C to terminate. You may disconnect your device. Wrote profiles to /tmp/profile-1283e247-2170-4f92-8181-683763e17445 (symlink /tmp/heap_profile-latest) These can be viewed using pprof. Googlers: head to pprof/ and upload them.
raw-trace file from the output directory to the Perfetto UI and click on diamond marker in the UI track labeled