OLD | NEW |
---|---|
1 # Heap Profiling with MemoryInfra | 1 # Heap Profiling with MemoryInfra |
2 | 2 |
3 As of Chrome 48, MemoryInfra supports heap profiling. The core principle is | 3 As of Chrome 48, MemoryInfra supports heap profiling. The core principle is |
4 a solution that JustWorks™ on all platforms without patching or rebuilding, | 4 a solution that JustWorks™ on all platforms without patching or rebuilding, |
5 integrated with the chrome://tracing ecosystem. | 5 integrated with the chrome://tracing ecosystem. |
6 | 6 |
7 [TOC] | 7 [TOC] |
8 | 8 |
9 ## How to Use | 9 ## How to Use |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... | |
31 | 31 |
32 [memory-infra]: README.md | 32 [memory-infra]: README.md |
33 [m-purple]: https://storage.googleapis.com/chromium-docs.appspot.com/d7bd f4d16204c293688be2e5a0bcb2bf463dbbc3 | 33 [m-purple]: https://storage.googleapis.com/chromium-docs.appspot.com/d7bd f4d16204c293688be2e5a0bcb2bf463dbbc3 |
34 [cells-heap-dump]: https://storage.googleapis.com/chromium-docs.appspot.com/a24d 80d6a08da088e2e9c8b2b64daa215be4dacb | 34 [cells-heap-dump]: https://storage.googleapis.com/chromium-docs.appspot.com/a24d 80d6a08da088e2e9c8b2b64daa215be4dacb |
35 | 35 |
36 ### Native stack traces | 36 ### Native stack traces |
37 | 37 |
38 By default heap profiling collects pseudo allocation traces, which are based | 38 By default heap profiling collects pseudo allocation traces, which are based |
39 on trace events. I.e. frames in allocation traces correspond to trace events | 39 on trace events. I.e. frames in allocation traces correspond to trace events |
40 that were active at the time of allocations, and are not real function names. | 40 that were active at the time of allocations, and are not real function names. |
41 However, you can build a special Linux / Android build that will collect | 41 It's also possible to use heap profiling with native, symbolized stack traces. |
awong
2017/06/22 21:43:51
Add a note that it's for official builds.
erikchen
2017/06/22 21:55:56
Renamed the sections below to distinguish between
| |
42 real C/C++ stack traces. | 42 |
43 #### Native stack traces (macOS/Windows) | |
44 | |
45 1. Navigate to chrome://flags, and set "enable-heap-profiling" to Enabled | |
46 (native mode). | |
47 | |
48 2. Use the [TraceOnTap][extension-link] extension to grab a trace. | |
49 | |
50 3. Run the following script to symbolize the trace. | |
51 | |
52 third_party/catapult/tracing/bin/symbolize_trace <trace file> | |
53 | |
54 4. Load the trace file in `chrome://tracing`. Locate a purple ![M][m-purple] | |
55 dot, and continue from step *3* from the instructions above. Native stack | |
56 traces will be shown in the _Heap Details_ pane. | |
57 | |
58 [extension-link]: https://cs.chromium.org/chromium/src/third_party/catapult/expe rimental/trace_on_tap/?q=traceontap+package:%5Echromium$&dr=CSs | |
59 | |
60 #### Native stack traces (Android/Linux) | |
61 | |
62 On Linux / Android, you need to build Chromium with special flags to use native | |
63 heap profiling. | |
43 | 64 |
44 1. Build with the following GN flags: | 65 1. Build with the following GN flags: |
45 | 66 |
46 Linux | 67 Linux |
47 | 68 |
48 enable_profiling = true | 69 symbol_level = 1 |
DmitrySkiba
2017/06/22 21:44:32
Why are you removing this? Without enable_profilin
erikchen
2017/06/22 21:55:55
See very long discussion on https://bugs.chromium.
|
awong
2017/06/22 21:43:51
Move the `symbol_level` change into a note or sect
erikchen
2017/06/22 21:55:56
Add comments for macOS / Windows w.r.t. symbol_lev
|
49 | 70 |
50 | 71 |
51 Android | 72 Android |
52 | 73 |
53 arm_use_thumb = false | 74 arm_use_thumb = false |
54 enable_profiling = true | 75 enable_profiling = true |
76 symbol_level = 1 | |
55 | 77 |
56 2. Start Chrome with `--enable-heap-profiling=native` switch (notice | 78 2. Start Chrome with `--enable-heap-profiling=native` switch (notice |
57 `=native` part). | 79 `=native` part). |
58 | 80 |
59 On Android use the command line tool before starting the app: | 81 On Android use the command line tool before starting the app: |
60 | 82 |
61 build/android/adb_chrome_public_command_line --enable-heap-profiling=nat ive | 83 build/android/adb_chrome_public_command_line --enable-heap-profiling=nat ive |
62 | 84 |
63 (run the tool with an empty argument `''` to clear the command line) | 85 (run the tool with an empty argument `''` to clear the command line) |
64 | 86 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 memory allocated by PartitionAlloc alone, the total renderer memory increase was | 181 memory allocated by PartitionAlloc alone, the total renderer memory increase was |
160 around 72 MiB.) | 182 around 72 MiB.) |
161 | 183 |
162 ![Diff of The Verge before and after loading ads][diff] | 184 ![Diff of The Verge before and after loading ads][diff] |
163 | 185 |
164 [pseudo-stack]: https://storage.googleapis.com/chromium-docs.appspot. com/058e50350836f55724e100d4dbbddf4b9803f550 | 186 [pseudo-stack]: https://storage.googleapis.com/chromium-docs.appspot. com/058e50350836f55724e100d4dbbddf4b9803f550 |
165 [break-down-by-backtrace]: https://storage.googleapis.com/chromium-docs.appspot. com/ec61c5f15705f5bcf3ca83a155ed647a0538bbe1 | 187 [break-down-by-backtrace]: https://storage.googleapis.com/chromium-docs.appspot. com/ec61c5f15705f5bcf3ca83a155ed647a0538bbe1 |
166 [break-down-by-type]: https://storage.googleapis.com/chromium-docs.appspot. com/2236e61021922c0813908c6745136953fa20a37b | 188 [break-down-by-type]: https://storage.googleapis.com/chromium-docs.appspot. com/2236e61021922c0813908c6745136953fa20a37b |
167 [type-then-backtrace]: https://storage.googleapis.com/chromium-docs.appspot. com/c5367dde11476bdbf2d5a1c51674148915573d11 | 189 [type-then-backtrace]: https://storage.googleapis.com/chromium-docs.appspot. com/c5367dde11476bdbf2d5a1c51674148915573d11 |
168 [diff]: https://storage.googleapis.com/chromium-docs.appspot. com/802141906869cd533bb613da5f91bd0b071ceb24 | 190 [diff]: https://storage.googleapis.com/chromium-docs.appspot. com/802141906869cd533bb613da5f91bd0b071ceb24 |
OLD | NEW |