A Lightweight Approach to Detect Memory Leaks in JavaScript (S)

Although with garbage collection support, many JavaScript programs still suffer from memory leaks. These leaks can affect application performance and even cause crashes, especially for single page websites. The existing work on JavaScript memory leak mainly focuses on the static detection of leaks toward certain leak patterns. The application scope of such approaches are limited. Previous techniques used for detecting memory leaks in Javalike languages might be extended to JavaScript. However, how to apply these techniques in JavaScript is still a problem. In this paper, we firstly present many common leak detection heuristics used in garbage-collected languages and investigate their effectiveness on JavaScript. According to the investigation results, we then propose a lightweight multi-snapshots based dynamic leak detection method for JavaScript. The initial experimental results show that the proposed approach is effective. Keywordsmemory leak; JavaScript; dynamic analysis

[1]  Nick Mitchell,et al.  LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications , 2003, ECOOP.

[2]  Satish Narayana Srirama,et al.  Memory leak detection in Java: Taxonomy and classification of approaches , 2014, J. Syst. Softw..

[3]  Paul A. S. Ward,et al.  LeakSpot: detection and diagnosis of memory leaks in JavaScript applications , 2017, Softw. Pract. Exp..

[4]  Di Zhou,et al.  Prioritizing Test Cases for Memory Leaks in Android Applications , 2016, Journal of Computer Science and Technology.

[5]  Kung Chen,et al.  Aspect-Based Instrumentation for Locating Memory Leaks in Java Programs , 2007, 31st Annual International Computer Software and Applications Conference (COMPSAC 2007).

[6]  Naren Ramakrishnan,et al.  Diagnosing memory leaks using graph mining on heap dumps , 2010, KDD.

[7]  Manu Sridharan,et al.  MemInsight: platform-independent memory debugging for JavaScript , 2015, ESEC/SIGSOFT FSE.

[8]  Xiaohua Shi,et al.  LeakTracer: Tracing leaks along the way , 2015, 2015 IEEE 15th International Working Conference on Source Code Analysis and Manipulation (SCAM).

[9]  Derek Rayside,et al.  Object ownership profiling: a technique for finding and fixing memory leaks , 2007, ASE.

[10]  Kathryn S. McKinley,et al.  Cork: dynamic memory leak detection for garbage-collected languages , 2007, POPL '07.

[11]  Robert Hundt,et al.  JSWhiz: Static analysis for JavaScript memory leaks , 2013, Proceedings of the 2013 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).