Lessons Learned from the �Memory Roadshow
Michael Hablich, hablich@chromium.org
Hannes Payer, hpayer@chromium.org
V8
Why memory matters to Chrome ...
30 % of all renderer crashes on Windows are because of out of memory situations
… so, we can make Chrome crash 30 % less often? Sweet!
What’s the reason for all these OOM crashes?
Is it Chrome?
Is it the Web?
Hypothesis
The majority of OOMs are caused by webpages?*
*proof pending :-P
How are we going to do it?
Let's ask the web developers!
Conduct a roadshow with �popular web applications.
How much memory do I really use?
Where do I start?
Why do I use so much memory?
How slim should a webpage be?
How do I convince my manager to work on memory reduction?
Where do I start?
Where do I start?
What we can do:
Memory
How much memory does this page use on different device classes
Memory
These encapsulate your we app's current memory consumption and opportunities to improve it.
Metrics
These metrics encapsulate your we app's current memory consumption across a number of dimensions.
30 MB
120 MB
60 MB
Reduce the code cached or loaded just in case
35 % of your shipped code on startup is not executed 35 % less code size
Investigate potential leaky objects
A few objects were found that are potentially thus never free memory 7 objects to investigate
Loading the web site would fail on some devices
Android devices with <= 1024 MB RAM would likely fail loading your page.
Where do I start?
What we can do:
Where do I start?
What we can do:
How much memory do I really use?
How much memory do I really use?
What we can do:
performance.memory
Today:
performance.memory
Today:
The (maybe) future:
https://github.com/erikchen/performance-memory
Why do I use so much memory?
Fix the retaining path in DevTools
Fix the retaining path in DevTools
M65
We fixed the glitch.
Fix the retaining path in DevTools
M66
How slim should a web page be?
What we can do:
PageSpeed+Memory Insights
How do I convince my manager …?
Memory Pressure & OOM Handling
prOOMpt
How do I convince my manager …?
What we can do:
Hypothesis: The majority of OOMs are caused by webpages?
We found memory leaks in all web pages �of the memory roadshow attendees.
Hypothesis: The majority of OOMs are caused by webpages?
That is not a proof...
We found memory leaks in all web pages �of the memory roadshow attendees.
Want to get involved? Have an opinion? Think we are wrong? Good! Participate in the relevant unconference sessions and talks this BlinkOn:
… or simply talk to us!
The Wrap a.k.a. Key Takeaways
We need to incentivise web developers to care more about memory
We need to provide them with the means to reliably measure and benchmark memory consumption
We need to give them the right tools to fix the problems on their own