• Home
  • Raw
  • Download

Lines Matching +full:java +full:- +full:docs +full:- +full:samples

7 attribute memory usage to particular call-stacks, supporting a mix of both
8 native and java code. The tool can be used by Android platform and app
12 malloc/free (or new/delete). It can be configured to record java heap memory
13 allocations instead: see [Java heap sampling](#java-heap-sampling) below.
21 See the [Memory Guide](/docs/case-studies/memory.md#heapprofd) for getting
30 ![heapprofd snapshots in the UI tracks](/docs/images/profile-diamond.png)
32 ![heapprofd flamegraph](/docs/images/native-heap-prof.png)
38 * [`stack_profile_mapping`](/docs/analysis/sql-tables.autogen#stack_profile_mapping)
39 * [`stack_profile_frame`](/docs/analysis/sql-tables.autogen#stack_profile_frame)
40 * [`stack_profile_callsite`](/docs/analysis/sql-tables.autogen#stack_profile_callsite)
43 [`heap_profile_allocation`](/docs/analysis/sql-tables.autogen#heap_profile_allocation).
46 [`stack_profile_symbol`](/docs/analysis/sql-tables.autogen#stack_profile_symbol).
48 See [Example Queries](#heapprofd-example-queries) for example SQL queries.
57 [HeapprofdConfig](/docs/reference/trace-config-proto.autogen#HeapprofdConfig)
68 You can target processes either by name (`-n com.example.myapp`) or by PID
69 (`-p 1234`). In the first case, the heap profile will be initiated on both on
70 already-running processes that match the package name and new processes launched
73 [heap_profile cmdline reference page](/docs/reference/heap_profile-cli).
76 Upload the `raw-trace` file in your output directory. You will see all heap
92 ![Profile Diamond](/docs/images/profile-diamond.png)
132 [HeapprofdConfig](/docs/reference/trace-config-proto.autogen#HeapprofdConfig).
133 * By adding `-c 5000` to the invocation of
134 [`tools/heap_profile`](/docs/reference/heap_profile-cli).
136 ![Continuous dump flamegraph](/docs/images/heap_prof_continuous.png)
144 Heapprofd samples heap allocations by hooking calls to malloc/free and C++'s
156 See the [heapprofd Sampling](/docs/design-docs/heapprofd-sampling) document for
166 On Android, Java apps are usually not exec()-ed from scratch, but fork()-ed from
178 [ProfilePacket]: /docs/reference/trace-packet-proto.autogen#ProfilePacket
179 [zygote]: https://developer.android.com/topic/performance/memory-overview#SharingRAM
215 ## {#heapprofd-targets} Target processes
220 On _user_ (i.e. production, non-rootable) builds, only Java applications with
222 Profiling requests for non-profileable/debuggable processes will result in an
230 `adb shell su root setenforce 0` or by passing `--disable-selinux` to the
236 |-------------------------|:----------------------:|:---------:|:----:|
257 ## {#java-heap-sampling} Java heap sampling
259 NOTE: **Java heap sampling is available on Android 12 or higher**
261 NOTE: **Java heap sampling is not to be confused with [Java heap
262 dumps](/docs/data-sources/java-heap-profiler.md)**
264 Heapprofd can be configured to track Java allocations instead of native ones.
266 [HeapprofdConfig](/docs/reference/trace-config-proto.autogen#HeapprofdConfig).
267 * By adding `--heaps com.android.art` to the invocation of
268 [`tools/heap_profile`](/docs/reference/heap_profile-cli).
270 Unlike java heap dumps (which show the retention graph of a snapshot of the live
271 objects) but like native heap profiles, java heap samples show callstacks of
274 Java heap samples only show callstacks of when objects are created, not when
277 ![javaheapsamples](/docs/images/java-heap-samples.png)
288 Java heap samples are useful to understand memory churn showing the call stack
294 If the name of a Java method includes `[DEDUPED]`, this means that multiple
305 `adb shell killall -USR1 heapprofd`. This can be useful in lab tests for
314 ### Set up llvm-symbolizer
318 To use symbolization, your system must have llvm-symbolizer installed and
319 accessible from `$PATH` as `llvm-symbolizer`. On Debian, you can install it
331 PERFETTO_BINARY_PATH=somedir tools/heap_profile --name ${NAME}
335 `PERFETTO_BINARY_PATH=somedir tools/traceconv symbolize raw-trace > symbols`.
337 `cat raw-trace symbols > symbolized-trace`) and the symbols will part of
338 `symbolized-trace`. The `tools/heap_profile` script will also generate this
349 5. in the subdirectory .build-id: the first two hex digits of the build-id
361 5. $PERFETTO_BINARY_PATH/.build-id/ab/cd1234.debug
370 If your profile contains obfuscated Java methods (like `fsd.a`), you can
399 size (passing `--shmem-size` to `tools/heap_profile`) can resolve the issue.
401 accuracy in the resulting profile) by passing `--interval=16000` or higher.
406 [Target processes](#heapprofd-targets) above.
408 Also check the [Known Issues](#known-issues).
413 sure no [DEDUPED frames](#deduped-frames) are involved.
416 (ICF), i.e. passing `-Wl,--icf=...` to the linker, most trivial functions, often
417 constructors and destructors, can be aliased to binary-equivalent operators
425 Could not find /data/app/invalid.app-wFgo3GRaod02wSvPZQ==/lib/arm64/somelib.so
432 `readelf -n /path/in/binary/path/somelib.so`. If it does not match, the
446 Frame-pointer unwinding is *not supported*.
451 $ readelf -S file.so | grep "gnu_debugdata\|eh_frame\|debug_frame"
460 ## (non-Android) Linux support
465 First [build Perfetto](/docs/contributing/build-instructions.md). You only need
470 ninja -C out/linux_clang_release
482 tools/heap_profile -n trace_processor_shell --print-config | \
484 -c - --txt \
485 -o ~/heapprofd-trace
494 Then, Ctrl-C the Perfetto invocation and upload ~/heapprofd-trace to the
506 ### {#known-issues-android13} Android 13
508 * Unwinding java frames might not work properly, depending on the ART module
512 ### {#known-issues-android12} Android 12
514 * Unwinding java frames might not work properly, depending on the ART module
518 ### {#known-issues-android11} Android 11
520 * 32-bit programs cannot be targeted on 64-bit devices.
531 ### {#known-issues-android10} Android 10
536 * 32-bit programs cannot be targeted on 64-bit devices.
540 * On ARM32, the bottom-most frame is always `ERROR 2`. This is harmless and
549 `java.lang.Runtime.exec` does this, calling it will prematurely end
566 requested from the default C/C++ allocator. If you are profiling a Java app from
573 `am dumpheap -m <PID> /data/local/tmp/heap.txt`. This will in general be more
588 |---------------------|:-----------------:|:------------:|:---:|
600 You can use [traceconv](/docs/quickstart/traceconv.md) to convert the heap dumps
602 then be viewed using the pprof CLI or a UI (e.g. Speedscope, or Google-internal
612 gzip /tmp/heap_profile-XXXXXX/*.pb
617 ## {#heapprofd-example-queries} Example SQL Queries
636 |-------------|----|------|-------|-----------|------|--------|----------|------|
662 -- The type of the profile from which the flamegraph is being generated.
663 -- Always 'native' for native heap profiles.
665 -- The timestamp of the heap profile.
667 -- Timestamp constraints: not relevant and always null for native heap
668 -- profiles.
670 -- The upid of the heap profile.
672 -- The upid group: not relevant and always null for native heap profiles.
674 -- A regex for focusing on a particular node in the heapgraph: for advanced
675 -- use only.
682 |------|----------|----------------|