DocumentCode
17958
Title
Light-weight resource leak testing based on finalisers
Author
Ziying Dai ; Xiaoguang Mao
Author_Institution
Coll. of Comput., Nat. Univ. of Defense Technol., Changsha, China
Volume
7
Issue
6
fYear
2013
fDate
Dec-13
Firstpage
308
Lastpage
316
Abstract
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.
Keywords
Java; application program interfaces; program testing; Java API classes; Java programs; application program interfaces; finalisers; light-weight resource leak testing; object finalisation; performance cost; resource classes; resource object cleanup method;
fLanguage
English
Journal_Title
Software, IET
Publisher
iet
ISSN
1751-8806
Type
jour
DOI
10.1049/iet-sen.2013.0026
Filename
6680573
Link To Document