A Specification-Based Approach to the Testing of Java Memory Bloat

Inefficient use of memory may cause memory bloat, and the bloat may lead to performance slowdowns or even crashes. To address the problem, lots of efforts have been devoted to the diagnosing of bloat, especially the bloat caused by memory leaks. However, testing and identifying the executions potentially containing bloat, which act as key steps before diagnosing, are still challenging. In this paper, we introduce a memory specification tool named MemSpec to help programmers test memory inefficiencies in Java programs. The specification works as a test oracle to automatically determine whether a program suffers from memory bloat. Users can write their own memory specifications using our specification language. MemSpec weaves the specification checking mechanisms into the tested programs. During test runs, memory bloat will be reported if the some specifications are not satisfied. With this specification-based approach, a tester does not need to manually watch the program executions to identify bloat. The automatically reporting of memory bloat can reduce the manual efforts in memory inefficiency testing. We test the proposed approach on ArgoUML. The initial results show that it is effective.

[1]  Satish Narayana Srirama,et al.  Memory leak detection in Plumbr , 2015, Softw. Pract. Exp..

[2]  Samuel Z. Guyer,et al.  GC assertions: using the garbage collector to check heap properties , 2008, MSPC '08.

[3]  Kathryn S. McKinley,et al.  A service-based runtime environment for native applications , 2010 .

[4]  Ju Qian,et al.  Inferring weak references for fixing Java memory leaks , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

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

[6]  Atanas Rountev,et al.  Systematic testing for resource leaks in Android applications , 2013, 2013 IEEE 24th International Symposium on Software Reliability Engineering (ISSRE).

[7]  Kathryn S. McKinley,et al.  Detecting memory leaks in managed languages with Cork , 2010, Softw. Pract. Exp..

[8]  Michael D. Bond,et al.  Tolerating memory leaks , 2008, OOPSLA.

[9]  Michael D. Bond,et al.  LeakChaser: helping programmers narrow down causes of memory leaks , 2011, PLDI '11.

[10]  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).

[11]  Matthew Arnold,et al.  Software bloat analysis: finding, removing, and preventing performance problems in modern large-scale object-oriented applications , 2010, FoSER '10.

[12]  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).

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

[14]  Atanas Rountev,et al.  LeakChecker: Practical Static Memory Leak Detection for Managed Languages , 2014, CGO '14.

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