| 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 intergrated 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 |
| 11 1. Start Chrome with the `--enable-heap-profiling` switch. This will make | 11 1. Start Chrome with the `--enable-heap-profiling` switch. This will make |
| 12 Chrome keep track of all allocations. | 12 Chrome keep track of all allocations. |
| 13 | 13 |
| 14 2. Grab a [MemoryInfra][memory-infra] trace. For best results, start tracing | 14 2. Grab a [MemoryInfra][memory-infra] trace. For best results, start tracing |
| 15 first, and _then_ open a new tab that you want to trace. Furthermore, | 15 first, and _then_ open a new tab that you want to trace. Furthermore, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 The other way to break down the heap is by object type. At the moment this is | 114 The other way to break down the heap is by object type. At the moment this is |
| 115 only supported for PartitionAlloc. | 115 only supported for PartitionAlloc. |
| 116 | 116 |
| 117 *** aside | 117 *** aside |
| 118 In official builds, only the most common type names are included due to binary | 118 In official builds, only the most common type names are included due to binary |
| 119 size concerns. Development builds have full type information. | 119 size concerns. Development builds have full type information. |
| 120 *** | 120 *** |
| 121 | 121 |
| 122 To keep the trace log small, uninteresting information is omitted from heap | 122 To keep the trace log small, uninteresting information is omitted from heap |
| 123 dumps. The long tail of small nodes is not dumped, but grouped in an `<other>` | 123 dumps. The long tail of small nodes is not dumped, but grouped in an `<other>` |
| 124 node instead. Note that altough these small nodes are insignificant on their | 124 node instead. Note that although these small nodes are insignificant on their |
| 125 own, together they can be responsible for a significant portion of the heap. The | 125 own, together they can be responsible for a significant portion of the heap. The |
| 126 `<other>` node is large in that case. | 126 `<other>` node is large in that case. |
| 127 | 127 |
| 128 ## Example | 128 ## Example |
| 129 | 129 |
| 130 In the trace below, `ParseAuthorStyleSheet` is called at some point. | 130 In the trace below, `ParseAuthorStyleSheet` is called at some point. |
| 131 | 131 |
| 132 ![ParseAuthorStyleSheet pseudo stack][pseudo-stack] | 132 ![ParseAuthorStyleSheet pseudo stack][pseudo-stack] |
| 133 | 133 |
| 134 The pseudo stack of trace events corresponds to the tree of ƒ nodes below. Of | 134 The pseudo stack of trace events corresponds to the tree of ƒ nodes below. Of |
| (...skipping 24 matching lines...) Expand all Loading... |
| 159 memory allocated by PartitionAlloc alone, the total renderer memory increase was | 159 memory allocated by PartitionAlloc alone, the total renderer memory increase was |
| 160 around 72 MiB.) | 160 around 72 MiB.) |
| 161 | 161 |
| 162 ![Diff of The Verge before and after loading ads][diff] | 162 ![Diff of The Verge before and after loading ads][diff] |
| 163 | 163 |
| 164 [pseudo-stack]: https://storage.googleapis.com/chromium-docs.appspot.
com/058e50350836f55724e100d4dbbddf4b9803f550 | 164 [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 | 165 [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 | 166 [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 | 167 [type-then-backtrace]: https://storage.googleapis.com/chromium-docs.appspot.
com/c5367dde11476bdbf2d5a1c51674148915573d11 |
| 168 [diff]: https://storage.googleapis.com/chromium-docs.appspot.
com/802141906869cd533bb613da5f91bd0b071ceb24 | 168 [diff]: https://storage.googleapis.com/chromium-docs.appspot.
com/802141906869cd533bb613da5f91bd0b071ceb24 |
| OLD | NEW |