MemoryInfra is a timeline-based profiling system integrated inchrome://tracing. It aims at creating Chrome-scale memory measurement tooling so that on any Chrome in the world --- desktop, mobile, Chrome OS or any other --- with the click of a button you can understand where memory is being used in your system.
Record a trace as usual: openchrome://tracing on Desktop Chrome orchrome://inspect to trace Chrome for Android.
Make sure to enable thememory-infra category on the right.
After recording a trace, you will see thetimeline view. Thetimeline view is primarily used for other tracing features. Click one of the dots to bring up theanalysis view. Click on a cell in analysis view to reveal more information about its subsystem. PartitionAlloc for instance, has more details about its partitions.
The full details of the MemoryInfra UI are explained in itsdesign doc.
Columns in blue reflect the amount of actual physical memory used by the process. This is what exerts memory pressure on the system.
Columns in black reflect a best estimation of the amount of physical memory used by various subsystems of Chrome.
malloc
, ornew
for most non-Blink objects.Thetracing column in gray reports memory that is used to collect all of the above information. This memory would not be used if tracing were not enabled, and it is discounted from malloc and the blue columns.
This is a little like the difference between ‘self time’ and ‘cumulative time’ in a profiling tool. Size is the total amount of memory allocated/requested by a subsystem whereas effective size is the total amount of memory used/consumed by a subsystem. If Skia allocates 10mb via partition_alloc that memory would show up in the size of both Skia and partition_alloc but only in the effective size of Skia since although partition_alloc allocates the 10mb it does so on behalf of Skia which is responsible for the memory. Summing all effective sizes gives the total amount of memory used whereas summing size would give a number larger than the total amount of memory used.
Another memory profiler? What is wrong with tool X? Most of the existing tools:
MemoryInfra leverages the existing tracing infrastructure in Chrome and provides contextual data:
__gnu_cxx::new_allocator< std::_Rb_tree_node< std::pair< std::string const, base::Value*>>> ::allocate
.MemoryInfra is based on a simple and extensible architecture. Seethe slides on how to get your subsystem reported in MemoryInfra, or take a look at one of the existing examples such asmalloc_dump_provider.cc. The crbug label isHotlist-MemoryInfra. Don't hesitate to contacttracing@chromium.org for questions and support.
Architectural:
Chrome-side design docs:
Catapult-side design docs: