Light-weight resource leak testing based on finalisers

被引:0
作者
Dai, Ziying [1 ]
Mao, Xiaoguang [1 ]
机构
[1] Natl Univ Def Technol, Coll Comp, Changsha 410073, Hunan, Peoples R China
基金
中国国家自然科学基金; 国家高技术研究发展计划(863计划);
关键词
application program interfaces; !text type='Java']Java[!/text; program testing; light-weight resource leak testing; finalisers; performance cost; object finalisation; resource object cleanup method; resource classes; !text type='Java']Java[!/text] API classes; !text type='Java']Java[!/text] programs; SPECIFICATIONS; EFFICIENT; LANGUAGE; RUNTIME;
D O I
10.1049/iet-sen.2013.0026
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Despite garbage collectors, programmers must manually manage many non-memory finite system resources' such as file descriptors and database connections. Unreleased resources result in resource leaks' that degrade application performance and can even result in system crashes. It is hard to test resource leaks because of their no immediate symptoms in the short run. There are analysis techniques to detect resource leaks statically or dynamically. However, all of them require the formal specification as input, which seriously decrease their practicability for common software developers. In this study, the authors propose an easy-to-use yet effective resource leak testing approach for Java programs based on existing finalisers of Java Application Programming Interface (API) classes. They instrument resource classes to check that the cleanup method of a resource object is called before its finaliser's execution. Otherwise, this resource object is leaked. To use this approach, programmers just add a few lines of code into their programs and no formal specifications are required. They carry out experiments on benchmarks in the literature to evaluate the incidence of object finalisation and performance cost of finalisers. Experimental results show that the authors' approach can test leaks of most system resources with high effectiveness and low overhead.
引用
收藏
页码:308 / 316
页数:9
相关论文
共 21 条
[1]   GC Assertions: Using the Garbage Collector to Check Heap Properties [J].
Aftandilian, Edward E. ;
Guyer, Samuel Z. .
ACM SIGPLAN NOTICES, 2009, 44 (06) :235-244
[2]   Adding trace matching with free variables to AspectJ [J].
Allan, C ;
Avgustinov, P ;
Christensen, AS ;
Hendren, L ;
Kuzins, S ;
Lhoták, O ;
de Moor, O ;
Sereni, D ;
Sittampalam, G ;
Tibble, J .
ACM SIGPLAN NOTICES, 2005, 40 (10) :345-364
[3]  
[Anonymous], 2010, P 32 ACM IEEE INT C
[4]   QVM: An Efficient Runtime for Detecting Defects in Deployed Systems [J].
Arnold, Matthew ;
Vechev, Martin ;
Yahav, Eran .
ACM SIGPLAN NOTICES, 2008, 43 (10) :143-162
[5]   Software testing research: Achievements, challenges, dreams [J].
Bertolino, Antonia .
FOSE 2007: FUTURE OF SOFTWARE ENGINEERING, 2007, :85-103
[6]   The DaCapo benchmarks: Java']Java benchmarking development and analysis [J].
Blackburn, Stephen M. ;
Garner, Robin ;
Hoffmann, Chris ;
Khan, Asjad M. ;
McKinley, Kathryn S. ;
Bentzur, Rotem ;
Diwan, Amer ;
Feinberg, Daniel ;
Frampton, Daniel ;
Guyer, Samuel Z. ;
Hirzel, Martin ;
Hosking, Antony ;
Jump, Maria ;
Lee, Han ;
Moss, J. Eliot B. ;
Phansalkar, Aashish ;
Stefanovic, Darko ;
VanDrunen, Thomas ;
von Dincklage, Daniel ;
Wiedermann, Ben .
ACM SIGPLAN NOTICES, 2006, 41 (10) :169-190
[7]  
Bloch Joshua, 2008, EFFECTIVE JAVA, P27
[8]   Destructors, finalizers, and synchronization [J].
Boehm, HJ .
ACM SIGPLAN NOTICES, 2003, 38 (01) :262-272
[9]   Tolerating Memory Leaks [J].
Bond, Michael D. ;
McKinley, Kathryn S. .
ACM SIGPLAN NOTICES, 2008, 43 (10) :109-125
[10]   MOP: An efficient and generic runtime verification framework [J].
Chen, Feng ;
Rosu, Grigore .
ACM SIGPLAN NOTICES, 2007, 42 (10) :569-588