skip to main content
research-article
Free access

BLeak: automatically debugging memory leaks in web applications

Published: 22 October 2020 Publication History

Abstract

Memory leaks in web applications are pervasive and difficult to debug. Leaks degrade responsiveness by increasing garbage collection costs and can even lead to browser tab crashes. Previous leak detection approaches designed for conventional applications are ineffective in the browser environment. Tracking down leaks currently requires intensive manual effort by web developers, which is often unsuccessful.
This paper introduces BLEAK (Browser Leak debugger), the first system for automatically debugging memory leaks in web applications. BLEAK'S algorithms leverage the observation that in modern web applications, users often repeatedly return to the same (approximate) visual state (e.g., the inbox view in Gmail). Sustained growth between round trips is a strong indicator of a memory leak. To use BLEAK, a developer writes a short script (17-73 LOC on our benchmarks) to drive a web application in round trips to the same visual state. BLEAK then automatically generates a list of leaks found along with their root causes, ranked by return on investment. Guided by BLEAK, we identify and fix over 50 memory leaks in popular libraries and apps including Airbnb, AngularJS, Google Analytics, Google Maps SDK, and jQuery. BLEAK'S median precision is 100%; fixing the leaks it identifies reduces heap growth by an average of 94%, saving from 0.5MB to 8MB per round trip.

References

[1]
Basques, K. Fix memory problems, 2017. https://developers.google.com/web/tools/chrome-devtools/memory-problems/.
[2]
Bond, M.D., McKinley, K.S. Bell: Bit-encoding online memory leak detection. In ASPLOS, ACM, San Jose, CA, 2006, 61--72.
[3]
Clause, J.A., Orso, A. LEAKPOINT: Pinpointing the causes of memory leaks. In ICSE, ACM, Cape Town, South Africa, 2010, 515--524.
[4]
Google. Speed up google chrome, 2017. https://support.google.com/chrome/answer/1385029.
[5]
Hara, K. Oilpan: GC for blink, 2013. https://docs.google.com/presentation/d/1YtfurcyKFS0hxP0nC3U6JJroM8aRP49Yf0QWznZ9jrk.
[6]
Hauswirth, M., Chilimbi, T.M. Low-overhead memory leak detection using adaptive statistical profiling. In ASPLOS, ACM, Boston, MA, 2004, 156--164.
[7]
Jensen, S.H., Sridharan, M., Sen, K., Chandra, S. MemInsight: Platform-independent memory debugging for JavaScript. In FSE, ACM, Bergamo, Italy, 2015, 345--356.
[8]
Lee, L, Hundt, R. BloatBusters: Eliminating memory leaks in Gmail, 2012. https://docs.google.com/presentation/d/lwUVmf78gG-ra5aOxvTfYdiLkdGaR9OhXRnOlIcEmu2s.
[9]
Mitchell, N., Sevitsky, G. LeakBot: An automated and lightweight tool for diagnosing memory leaks in large Java applications. In ECOOP, 2003, 351--377.
[10]
Mozilla. about: memory, 2017. https://developer.mozilla.org/en-US/docs/Mozilla/Performance/about:memory.
[11]
Nguyen, N. The best firefox ever, 2017. https://blog.mozilla.org/blog/2017/06/13/faster-better-firefox/.
[12]
Novark, G., Berger, E.D., Zorn, B.G. Efficiently and precisely locating memory leaks and bloat. In PLDI, ACM, Dublin, Ireland, 2009, 397--407.
[13]
Pienaar, J.A., Hundt, R. JSWhiz: Static analysis for JavaScript memory leaks. In CGO, IEEE Computer Society, Shenzhen, China, 2013, 11:1--11:11.
[14]
Rudafshani, M., Ward, P.A.S. Leakspot: Detection and diagnosis of memory leaks in javascript applications. Softw. Pract. Exp. 1, 47 (2017), 97--123.
[15]
Vilk, J., Berger, E.D. BLEAK: Automatically debugging memory leaks in web applications. In PLDI, ACM, Philadelphia, PA, 2018, 15--29.
[16]
Xu, G.H., Rountev, A. Precise memory leak detection for Java software using container profiling. TOSEM 3, 22 (2013):17:1--17:28.

Cited By

View all
  • (2023)LeakPair: Proactive Repairing of Memory Leaks in Single Page Web ApplicationsProceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE56229.2023.00097(1175-1187)Online publication date: 11-Nov-2023
  • (2021)Efficient heap monitoring tool for memory leak detection and root-cause analysis2021 IEEE International Conference on Big Data (Big Data)10.1109/BigData52589.2021.9671473(3020-3030)Online publication date: 15-Dec-2021
  • (2021)Automatic Performance Testing for Image Displaying in Android Apps2021 28th Asia-Pacific Software Engineering Conference (APSEC)10.1109/APSEC53868.2021.00039(317-326)Online publication date: Dec-2021

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Communications of the ACM
Communications of the ACM  Volume 63, Issue 11
November 2020
142 pages
ISSN:0001-0782
EISSN:1557-7317
DOI:10.1145/3431460
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 October 2020
Published in CACM Volume 63, Issue 11

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

  • National Science Foundation

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)683
  • Downloads (Last 6 weeks)116
Reflects downloads up to 14 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2023)LeakPair: Proactive Repairing of Memory Leaks in Single Page Web ApplicationsProceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE56229.2023.00097(1175-1187)Online publication date: 11-Nov-2023
  • (2021)Efficient heap monitoring tool for memory leak detection and root-cause analysis2021 IEEE International Conference on Big Data (Big Data)10.1109/BigData52589.2021.9671473(3020-3030)Online publication date: 15-Dec-2021
  • (2021)Automatic Performance Testing for Image Displaying in Android Apps2021 28th Asia-Pacific Software Engineering Conference (APSEC)10.1109/APSEC53868.2021.00039(317-326)Online publication date: Dec-2021

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Digital Edition

View this article in digital edition.

Digital Edition

Magazine Site

View this article on the magazine site (external)

Magazine Site

Login options

Full Access

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media