Hector Dearman | 33a7833 | 2021-04-21 14:02:30 +0100 | [diff] [blame] | 1 | # Visualising large traces |
| 2 | |
| 3 | Browsers often limit the amount of memory a site can use. |
| 4 | This can cause problems when visualising large traces. |
| 5 | |
| 6 | ## How to visualise large traces using the Perfetto UI |
| 7 | |
| 8 | Perfetto UI has support for a mode where the processing of the trace |
| 9 | is offloaded to a 'server' instance of `trace_processor` running natively on your local machine. |
| 10 | This server process can take full advantage of the RAM of your machine as well as running at full native (rather than WASM) performance. |
| 11 | |
| 12 | ``` |
| 13 | curl -LO https://get.perfetto.dev/trace_processor |
| 14 | chmod +x ./trace_processor |
| 15 | trace_processor --httpd /path/to/trace.pftrace |
| 16 | # Navigate to http://ui.perfetto.dev, it will prompt to use the HTTP+RPC interface |
| 17 | ``` |
| 18 | |
| 19 | ## How big is too big? |
| 20 | |
| 21 | The exact memory limit can vary by browser, architecture, and OS however 2gb is typical. |
| 22 | This limit is a limit on the total memory used at runtime, not on the binary size of the trace. |
| 23 | The `trace_processor` (and hence the UI) representation of a trace at runtime is normally larger than the binary size of that trace. |
| 24 | This is because the representation is optimized for query performance rather than size. |
| 25 | The exact inflation factor varies depending on the trace format but can be 2-4x for uncompressed proto traces. |
| 26 | |
| 27 | |