IntroductionDeep Memory Profiler (DMP) is a 1) whole-process, 2) timeline-based and 3) post-mortem memory profiler for Chromium. See the Design Doc if interested. Memory bloat has been a serious issue in Chromium for years. Bloat is harder to fix than leak and errors. We have memory checkers like Valgrind and Address Sanitizer for leak and errors, but no handy tools for bloat. DMP is an easy-to-use tool for bloat to know “who is the memory eater”. (It would be helpful also for leak.) AnnouncementFuture announcements (e.g. command line changes) will be done in dmprof@chromium.org. Subscribe it if you're interested. Sub-profilers
How to UseDMP profiles memory usage post-mortem. You need to 1) get memory dumps while Chrome is running, and then 2) analyze the dumps. The analyzing script dmprof is available in src/tools/deep_memory_profiler of the Chromium source tree, or can be retrieved by downloading and running download.sh. Phase 1: Get dumpsYou have three options to get dumps. Get dumps (A): Standalone Chromium
Get dumps (C): PyAuto
Get dumps (D): Telemetry
You can use Telemetry to drive chrome and, if running on android, to also fetch the files from the device. Use --profiler-tool=tcmalloc --profiler-dir=your_target with the measurement you want to track. |
| mustbezero & unhooked-absent | Should be zero. |
| unhooked-anonymous | VMA is mapped, but no information is recorded. No label is given in /proc/.../maps. |
| unhooked-file-exec | VMA is mapped, but no information is recorded. An executable file is mapped. |
| unhooked-file-nonexec | VMA is mapped, but no information is recorded. A non-executable file is mapped. |
| unhooked-file-stack | VMA is mapped, but no information is recorded. Used as a stack. |
| unhooked-other | VMA is mapped, but no information is recorded. Used for other purposes. |
| no-bucket | Should be small. Out of record because it is an ignorable small blocks. |
| tc-unused | Reserved by TCMalloc, but not used by malloc(). Headers, fragmentation and free-list. |
| mmap-v8 | mmap'ed for V8. It includes JavaScript heaps and JIT compiled code. |
| mmap-catch-all | mmap'ed for other purposes. |
| tc-used-all | All memory blocks allocated by malloc(). |
| mmap-v8-heap-newspace | JavaScript new (nursery) heap for younger objects. |
| mmap-v8-heap-coderange | Code produced at runtime including JIT-compiled JavaScript code. |
| mmap-v8-heap-pagedspace | JavaScript old heap and many other object spaces. |
| mmap-v8-other | Other regions mmap'ed by V8. |
| mmap-catch-all | Any other mmap'ed regions. |
| tc-v8 | Blocks allocated from V8. |
| tc-skia | Blocks allocated from Skia. |
| tc-webkit-catch-all | Blocks allocated from WebKit. |
| tc-unknown-string | Blocks which are related to std::string. |
| tc-catch-all | Any other blocks allocated by malloc(). |
| mmap-v8-heap-newspace | JavaScript new (nursery) heap for younger objects. |
| mmap-v8-heap-coderange | Code produced at runtime including JIT-compiled JavaScript code. |
| mmap-v8-heap-pagedspace | JavaScript old heap and many other spaces. |
| mmap-v8-other | Other regions mmap'ed by V8. |
| mmap-catch-all | Any other mmap'ed regions. |
| tc-webcore-fontcache | Blocks used for FontCache. |
| tc-skia | Blocks used for Skia. |
| tc-renderobject | Blocks used for RenderObject. |
| tc-renderstyle | Blocks used for RenderStyle. |
| tc-webcore-sharedbuf | Blocks used for WebCore's SharedBuffer. |
| tc-webcore-XHRcreate | Blocks used for WebCore's XMLHttpRequest (create). |
| tc-webcore-XHRreceived | Blocks used for WebCore's XMLHttpRequest (received). |
| tc-webcore-docwriter-add | Blocks used for WebCore's DocumentWriter. |
| tc-webcore-node-and-doc | Blocks used for WebCore's HTMLElement, Text, and other Node objects. |
| tc-webcore-node-factory | Blocks created by WebCore's HTML*Factory. |
| tc-webcore-element-wrapper | Blocks created by WebCore's createHTML*ElementWrapper. |
| tc-webcore-stylepropertyset | Blocks used for WebCore's StylePropertySet (CSS). |
| tc-webcore-style-createsheet | Blocks created by WebCore's StyleElement::createSheet. |
| tc-webcore-cachedresource | Blocks used for WebCore's CachedResource. |
| tc-webcore-script-execute | Blocks created by WebCore's ScriptElement::execute. |
| tc-webcore-events-related | Blocks related to WebCore's events (EventListener and so on) |
| tc-webcore-document-write | Blocks created by WebCore's Document::write. |
| tc-webcore-node-create-renderer | Blocks created by WebCore's Node::createRendererIfNeeded. |
| tc-webcore-render-catch-all | Any other blocks related to WebCore's Render. |
| tc-webcore-setInnerHTML-except-node | Blocks created by setInnerHTML. |
| tc-wtf-StringImpl-user-catch-all | Blocks used for WTF::StringImpl. |
| tc-wtf-HashTable-user-catch-all | Blocks used for WTF::HashTable. |
| tc-webcore-everything-create | Blocks created by WebCore's any create() method. |
| tc-webkit-from-v8-catch-all | Blocks created by V8 via WebKit functions. |
| tc-webkit-catch-all | Any other blocks created by WebKit. |
| tc-v8-catch-all | Any other blocks created in V8. |
| tc-toplevel-string | All std::string objects created at the top-level. |
| tc-catch-all | Any other blocks by malloc(). |
| mmap-v8 | mmap'ed for V8. It includes JavaScript heaps and JIT compiled code. |
| mmap-catch-all | mmap'ed for other purposes. |
| tc-std-string | std::string objects. |
| tc-WTF-String | WTF::String objects. |
| tc-no-typeinfo-StringImpl | No type_info (not allocated by 'new'), but allocated for StringImpl. |
| tc-Skia | Skia objects. |
| tc-WebCore-Style | WebCore's style objects. |
| tc-no-typeinfo-other | Any other blocks without type_info. |
| tc-other | All objects with other type_info. |
