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.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.