作者: John Vilk , Emery D. Berger
关键词:
摘要: 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.