BLeak: automatically debugging memory leaks in web applications

作者: John Vilk , Emery D. Berger

DOI: 10.1145/3192366.3192376

关键词:

摘要: Despite the presence of garbage collection in managed languages like JavaScript, memory leaks remain a serious problem. In context web applications, these are especially pervasive and difficult to debug. Web application can take many forms, including failing dispose unneeded event listeners, repeatedly injecting iframes CSS files, call cleanup routines third-party libraries. Leaks degrade responsiveness by increasing GC frequency overhead, even lead browser tab crashes exhausting available memory. Because previous leak detection approaches designed for conventional C, C++ or Java applications ineffective environment, tracking down currently requires intensive manual effort developers. This paper introduces BLeak (Browser Leak debugger), first system automatically debugging applications. BLeak's algorithms leverage observation that modern users often return same (approximate) visual state (e.g., inbox view Gmail). Sustained growth between round trips is strong indicator leak. To use BLeak, developer writes short script (17-73 LOC on our benchmarks) drive state. then generates list found along with their root causes, ranked investment. Guided we identify fix over 50 popular libraries apps Airbnb, AngularJS, Google Analytics, Maps SDK, jQuery. median precision 100%; fixing it identifies reduces heap an average 94%, saving from 0.5 MB 8 per trip. We believe approach be broadly applicable beyond GUI desktop mobile platforms.

参考文章(13)
James Teng Kin Lo, Eric Wohlstadter, Ali Mesbah, Imagen Proceedings of the 22nd international conference on World Wide Web - WWW '13. pp. 815- 826 ,(2013) , 10.1145/2488388.2488459
Nick Mitchell, Gary Sevitsky, LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications european conference on object-oriented programming. pp. 351- 377 ,(2003) , 10.1007/978-3-540-45070-2_16
J. A. Pienaar, R. Hundt, JSWhiz: Static analysis for JavaScript memory leaks symposium on code generation and optimization. pp. 1- 11 ,(2013) , 10.1109/CGO.2013.6495007
Maria Jump, Kathryn S. McKinley, Cork: dynamic memory leak detection for garbage-collected languages symposium on principles of programming languages. ,vol. 42, pp. 31- 38 ,(2007) , 10.1145/1190215.1190224
Simon Holm Jensen, Manu Sridharan, Koushik Sen, Satish Chandra, MemInsight: platform-independent memory debugging for JavaScript foundations of software engineering. pp. 345- 356 ,(2015) , 10.1145/2786805.2786860
Matthias Hauswirth, Trishul M. Chilimbi, Low-overhead memory leak detection using adaptive statistical profiling Proceedings of the 11th international conference on Architectural support for programming languages and operating systems - ASPLOS-XI. ,vol. 39, pp. 156- 164 ,(2004) , 10.1145/1024393.1024412
Michael D. Bond, Kathryn S. McKinley, Bell Proceedings of the 12th international conference on Architectural support for programming languages and operating systems - ASPLOS-XII. ,vol. 41, pp. 61- 72 ,(2006) , 10.1145/1168857.1168866
Emre Kiciman, Benjamin Livshits, AjaxScope Proceedings of twenty-first ACM SIGOPS symposium on Operating systems principles - SOSP '07. ,vol. 41, pp. 17- 30 ,(2007) , 10.1145/1294261.1294264
Edward E. Aftandilian, Samuel Z. Guyer, GC assertions Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation - PLDI '09. ,vol. 44, pp. 235- 244 ,(2009) , 10.1145/1542476.1542503
Gene Novark, Emery D. Berger, Benjamin G. Zorn, Efficiently and precisely locating memory leaks and bloat Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation - PLDI '09. ,vol. 44, pp. 397- 407 ,(2009) , 10.1145/1542476.1542521