Memory Leaks in Blink kouhei@ Photo © 2011 J. Ronald Lee.

Slides:



Advertisements
Similar presentations
An Implementation of Mostly- Copying GC on Ruby VM Tomoharu Ugawa The University of Electro-Communications, Japan.
Advertisements

Site Analysis. Why Site Analysis The Site Analysis function maps your entire website in 3-D, reports on broken links and identifies slow loading pages,
Paging: Design Issues. Readings r Silbershatz et al: ,
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Introduction to CSS.
Android Platform Overview (1)
Keeping our websites running - troubleshooting with Appdynamics Benoit Villaumie Lead Architect Guillaume Postaire Infrastructure Manager.
1 / 28 Modeling the HTML DOM and Browser API in Static Analysis of JavaScript Web Applications ESEC/FSE 2011 Anders Møller, Magnus Madsen and Simon Holm.
Memory issues in production systems. Production system Restricted access Application, DB, Application server, log files Debugging, monitoring Investigation.
An Empirical Study on the Rewritability of the with Statement in JavaScript Changhee Park (Joint work with Hongki Lee and Sukyoung Ryu) KAIST October.
Turning Eclipse Against Itself: Finding Errors in Eclipse Sources Benjamin Livshits Stanford University.
Swami NatarajanJune 17, 2015 RIT Software Engineering Reliability Engineering.
SE 450 Software Processes & Product Metrics Reliability Engineering.
Good & Bad Websites. From WEB 1. Submit one bad or ugly web site or web interface. This is ugly website because there are.
SE 450 Software Processes & Product Metrics 1 Defect Removal.
Microsoft ® Official Course Developing Optimized Internet Sites Microsoft SharePoint 2013 SharePoint Practice.
Memento: Learning Secrets from Process Footprints Suman Jana and Vitaly Shmatikov The University of Texas at Austin.
CIT 256 Mobile Web Development Dr. Beryl Hoffman.
Web Design and Patterns CMPT 281. Outline Motivation: customer-centred design Web design introduction Design patterns.
Our Experience Running YARN at Scale Bobby Evans.
Explain the purpose of an operating system
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
An Introduction To Websites With a little of help from “WebPages That Suck.
Software Development Software Testing. Testing Definitions There are many tests going under various names. The following is a general list to get a feel.
Point & Edit CMS An Introduction to Point & Edit.
AjaxScope & Doloto: Towards Optimizing Client-side Web 2.0 App Performance Ben Livshits Microsoft Research (joint work with Emre.
Embedded Software SKKU 14 1 Sungkyunkwan University Tizen v2.3 Application Profiling & Debugging.
Using Model Checking to Find Serious File System Errors StanFord Computer Systems Laboratory and Microsft Research. Published in 2004 Presented by Chervet.
Department of Computer Science Internet Performance Measurements using Firefox Extensions Scot L. DeDeo Professor Craig Wills.
Click to add text © 2012 IBM Corporation Design Manager Server Instrumentation Instrumentation Data Documentation Gary Johnston, Performance Focal Point,
Principles of effective web design NOTES Flo Morris-Duffin.
Putting Performance Best Practices Together to Create the Perfect SPA Chris Love2Dev.com.
OPTIMISING USER INTERFACES FOR MOBILE COMPUTER ASSISTED INTERVIEWING DEVICES Prepared By Otyek Ronald James Uganda Bureau of Statistics Presented at the.
Mantid Manipulation and Analysis Toolkit for ISIS data.
CSC 480 Software Engineering Test Planning. Test Cases and Test Plans A test case is an explicit set of instructions designed to detect a particular class.
Mobile Testing Overview. Agenda Mobile application quality poses a unique challenge Mobile changes the ALM cycle – Interoperability is unique to mobile.
ScriptOnce™ & Best Practices. Agenda 2 Automation that works ScriptOnce –Minimal maintenance –Easy to add devices Robustness –Reliable Scripts - Minimize.
Targeting Audiences Plus: Reliability & Performance Updates.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////
CIS-NG CASREP Information System Next Generation Shawn Baugh Amy Ramirez Amy Lee Alex Sanin Sam Avanessians.
Whole Page Performance Leeann Bent and Geoffrey M. Voelker University of California, San Diego.
How to Use an Android Tablet Well Come To You few Steps For How to Use an Android Tablet?
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Enhance Your Page Load Speed And Improve Traffic.
 Learn the mechanics of using App Inventor to build apps.  Learn how to design an app’s user interface with the App Inventor Designer, and its behavior.
Chapter 17 The Need for HTML 5.
Patrick Desbrow, CIO & VP of Engineering October 29, 2014
2017 Annual Assessment and Accountability Meeting
IT.CAS.Web2.0 Kyle Erickson
John Bordsen Technology Trainer Gail Borden Public Library District
Memory leaks in Android. Introduction In our day-to da life many apps crash,and the reason one will point to it is memory leak In majority of the cases.
My Oracle Support (The next generation Metalink experience) lynn
Some Important Techniques For Regression Testing That You Must Know.
What is the Difference between AMP and PWA
Introduction to CSS.
Business Transformation
Displaying Form Validation Info
Completing the tasks for A452 with….
Analyzing WebView Vulnerabilities in Android Applications
Background Energy efficiency is a critical issue for mobile device.
FRC Parts Exchange Guide to the site.
What’s Coming in IE8 Christian Stockwell Microsoft Corporation.
2/24/2019 6:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
HTML5 and Local Storage.
Landon Cox January 17, 2018 January 22, 2018
Yale Digital Conference 2019
10 REASONS TO USE JETPACK FOR WORDPRESS IN 2019
CSC 581: Mobile App Development
Presentation transcript:

Memory Leaks in Blink kouhei@ Photo © 2011 J. Ronald Lee.

Agenda: Memory Leaks Why should we care? Our work in Tokyo FasterDOM team Deep memory profiler Blink leak detector Real world leaks Summary

Why should we care about leaks? Memory usage of Chrome is a popular user complaint. Especially on mobiles! Leaks are expected to be the major cause of memory bloat.

Popular myth Renderer process die often, so we can have much leak as we want.

Wrong! Long running renderer process “Web apps” are open for a long time Gmail, SNS, etc. Chrome Apps/Extension/Background Pages Single renderer: Android WebView apps

Agenda: Memory Leaks Why should we care? Our work in Tokyo FasterDOM team Deep memory profiler Blink leak detector Real world leaks Summary

Tokyo memory efforts “Faster DOM” team in Tokyo is working on reducing renderer memory. Deep Memory Profiler: dmikurube@ Leak detector: kouhei@ and hajimehoshi@ Real world leak: hajimehoshi@ Oilpan

Deep Memory Profiler (dmprof) Provides in-depth view of Chromium/Blink heap allocations Not only leaks, but bloat Customizable how to breakdown http://dev.chromium.org/developers/deep-memory-profiler

Deep Memory Profiler (dmprof) Useful for first-step investigation: High level overview of memory issues. ex.) What obj is consuming all the memory.

Blink Leak Detector Detects WebCore::Document leaks from LayoutTests How to use: content_shell --dump-render-tree --enable-leak-detection run-webkit-tests --enable-leak-detection Watch waterfall

How does the leak detector work? Count number of documents Run a LayoutTest Force GC Count number of documents again if (diff > 0) report error.

Blink leak detector Current progress: 2013Q2: 1300 leaks out of 30000 2014Q2: 100 leaks out of 30000 The hard part: Long persisting leaks leads to codes relying on leaks. e.g.) SVG properties, editing, fonts, extensions, etc.

Real world leaks We wanted to know how the current leak impact users. + Specifically what leak bugs have impacted users. Summary: We navigated WebView to alexa top N websites and found that 294KB heap and ⅓ WebCore::Document is leaking per website.

Real world leaks: Method We investigated memory usage of WebView while visiting top N web sites. WebView uses single renderer instance, Auto navigate WebViewShell using adb input Trigger GC aggressively

First attempt

Memory usage jumps when loading certain websites naver.com globo.com wordpress.com Flaky!?

Measure at about:blank

What’s going on at wordpress.com? top page random website *.wordpress.com

Minimized wordpress.com <link rel="stylesheet" href="./noticons.css"> <body style="background-image:url(white.png)"> <p style="font-family:'Noticons';">a</p> </body> WOFF font

Minimized wordpress.com <link rel="stylesheet" href="./noticons.css"> <body style="background-image:url(white.png)"> <p style="font-family:'Noticons';">a</p> </body> WOFF font Removing this part fix the leak...

memory usage breakdown using primiano@’s tool Ashmem is increasing!

What is ashmem? Shared memory system specific to Android Linux Kernel Can be used to annotate cache regions Unpinned memory is held as long as system is not low on memory. Can be pinned again if the region was not evicted.

Who is using Ashmem? DiscardableMemoryAllocator wraps around ashmem. Add Printf at using ashmem as its backend. Region alloced for FontResource seems not released! → Font leak crbug.com/366533

Ashmem purging However, the leaked region is ~20MB. Too large for a font leak! 19MB was consumed by top background image. ashmem is only purged when at system is low on memory. We need to force purge for correct measurement!

Corrected graph

End? The overall (priv.dirty) memory usage is still increasing. The average leaked mem (KB) / visit is 390KB. WebCore::Document instances are also leaking: 294 documents are leaking after visiting 946 websites…

Agenda: Memory Leaks Why should we care? Our work in Tokyo FasterDOM team Deep memory profiler Blink leak detector Real world leaks Summary

Summary We still have a lot of memory leak in Blink. 390KB heap, ⅓ WebCore::Document leak per website. Tokyo team is investigating known leaks SVG, ServiceWorker, Fonts, etc. We should be careful not to introduce regressions Keep an eye on Webkit Linux Leak waterfall. We will contact you when we find new leaks.