HEAP_PROFILE(1)
NAME
heap_profile - record heap profile on Android device
DESCRIPTION
tools/heap_profile allows to collect native memory profiles on Android.
See Recording traces for more
details about the data-source.
usage: heap_profile [-h] [-i INTERVAL] [-d DURATION] [--no-start] [-p PIDS]
[-n NAMES] [-c CONTINUOUS_DUMP] [--disable-selinux]
[--no-versions] [--no-running] [--no-startup]
[--shmem-size SHMEM_SIZE] [--block-client]
[--block-client-timeout BLOCK_CLIENT_TIMEOUT]
[--no-block-client] [--idle-allocations] [--dump-at-max]
[--disable-fork-teardown] [--simpleperf]
[--traceconv-binary TRACECONV_BINARY]
[--print-config] [-o DIRECTORY]OPTIONS
-n,--nameNAMESComma-separated list of process names to profile.
-p,--pidPIDSComma-separated list of PIDs to profile.
-i,--intervalSampling interval. Default 4096 (4KiB)
-o,--outputDIRECTORYOutput directory.
--all-heapsCollect allocations from all heaps registered by target.
--block-clientWhen buffer is full, block the client to wait for buffer space. Use with caution as this can significantly slow down the client. This is the default
--block-client-timeoutIf --block-client is given, do not block any allocation for longer than this timeout (us).
-c,--continuous-dumpDump interval in ms. 0 to disable continuous dump.
-d,--durationDuration of profile (ms). 0 to run until interrupted. Default: until interrupted by user.
--disable-fork-teardownDo not tear down client in forks. This can be useful for programs that use vfork. Android 11+ only.
--disable-selinuxDisable SELinux enforcement for duration of profile.
--dump-at-maxDump the maximum memory usage rather than at the time of the dump.
-h,--helpshow this help message and exit
--heapsHEAPSComma-separated list of heaps to collect, e.g: malloc,art. Requires Android 12.
--idle-allocationsKeep track of how many bytes were unused since the last dump, per callstack
--no-android-tree-symbolizationDo not symbolize using currently lunched target in the Android tree.
--no-block-clientWhen buffer is full, stop the profile early.
--no-runningDo not target already running processes. Requires Android 11.
--no-startDo not start heapprofd.
--no-startupDo not target processes that start during the profile. Requires Android 11.
--no-versionsDo not get version information about APKs.
--print-configPrint config instead of running. For debugging.
--shmem-sizeSize of buffer between client and heapprofd. Default 8MiB. Needs to be a power of two multiple of 4096, at least 8192.
--simpleperfGet simpleperf profile of heapprofd. This is only for heapprofd development.
--traceconv-binaryPath to local trace to text. For debugging.