Memory-infra current state and plans
TRIM Conference - Nov 2016
What we have today
Memory-infra codebase in a nutshell
Probes in the codebase
Memory-infra codebase in a nutshell
Probes in the codebase
Memory-infra probes
All over the codebase
chrome://tracing
telemetry
Slow reports
Memory-infra codebase in a nutshell
Probes in the codebase
Heap Profiler
Heap Profiler
Instructions: https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/memory/heap-profiling-with-memory-infra
30.2 MiB
27.6
MiB
What’s next
Tracing Refactoring (Q3-Q4 16)
Allow reusing tracing in standalone projects
Stop maintaining N forked copied of tracing (webrtc, skia, v8)
Unblock 2 below
Stop OOM-ing when capturing big traces
Solve memory estimation problems
Moar data, smaller traces
Long tail of future improvements (don’t lose traces when navigating)
Memory-Infra UMA (Q1 17)
Today memory-infra is strongly coupled with tracing.
Good for debugging and telemetry, but still detached from UMA metrics.
What if
We could reuse the existing background-mode probes (the ones used by slow-reports) and use them to drive UMA?
Challenges:
Peak detection
Today memory-infra dumps only:
Idea:
Heap Profiler from the field
We are reaching good understanding of labs scenarios.
Need more understanding of the longtail from users.
Not convinced by statistical sampling approaches.
Want a full heap dump when chrome gets into awkward situations.
What was the content of the heap when the browser/renderer heap was 4 GB?
Memory-infra & benchmarks
TRIM Conference - Nov 2016
Current memory benchmarks
Memory.top_10_mobile: historical reasons, FG/BG, is going away.
System_health.memory_{mobile,desktop}
How do they look like on the dashboard?
Snapshots triggered by chrome events
Today memory benchmarks are fully driven by telemetry. Telemetry decides when to dump.
It’s a problem as it requires duplicating loading vs browsing stories.
Breaks the mental model of TBMv2 where a metric should be agnostic of the source of the trace (telemetry vs. field)
What’s going to change? What if:
Would this be enough to unify other benchmarks (e.g. v8) with sys health ones?
~200 metrics
(it is less scary than what it seems)
For each (device, page)
Browser_process
Renderer_processes
Gpu_process
All_processes (Σ)
Reported_by_os�(totals from system probes)�
Reported_by_chrome
(probes in the codebase)
system_memory
gpu_memory
private_dirty
Proportional resident
cc
V8
skia
...
gpu
blinkgc
webcache
...
New memory dashboard UI upcoming
Perf release notes