An object lifetime analysis algorithm is presented
which analyzes Java applications in just-in-time compiler in order to insert instructions to explicitly “free” objects into the applications
and reduces garbage collection overhead by assisting garbage collector in improving object allocation and reclamation. The proposed algorithm combines the live variable analysis and the pointer and escape analysis
and analyzes each method in Java applications only once. Moreover
the algorithm is inter-procedural
field sensitive and context sensitive
which can identify non-global objects and their dead locations in Java applications. Experimental results show that the proposed algorithm consumes 3.6%-5.3% of the total compilation time. The algorithm not only can identify the lifetime information of more objects than traditional ordinary escape analysis(such as that of Salagnac
et al)
but also can determine the object dead locations with the basic block precision in control flow graph of a method; Moreover
the algorithm can explicitly reclaims more memory spaces in just-in-time compiler assisted garbage collection.
关键词
Keywords
references
WHALEY J, RINARD M. Compositional pointer and escape analysis for java programs [J]. ACM SIGPLAN Notices, 1999, 34(10): 187-206.
CHOI J D, GUPTA M, SREEDHAR V C, et al. Escape analysis for Java [J]. ACM SIGPLAN Notices, 1999, 34(10): 1-19.
CHOI J D, GUPTA M, SERRANO M J, et al. Stack allocation and synchronization optimizations for java using escape analysis [J]. ACM Trans on Programming Languages and Systems, 2003, 25(6): 876-910.
SALCIANU A, RINARD M. Pointer and escape analysis for multithreaded programs [C]∥ACM SIGPLAN Symposium on Principles and Practices of Parallel Programming. New York, USA: ACM, 2001: 12-23.
SALAGNAC G, YOVINE S, GARBERVETSKY D. Fast escape analysis for region-based memory management [C]∥ 1st International Workshop on Abstract Interpretation for Object-Oriented Languages. Paris, France: ENTCS, 2005: 99-110.
GAY D, AIKEN A. Language support for regions [C]∥ACM SIGPLAN Conference on Program Language Design and Implementation. New York, UAS: ACM, 2001: 70-80.
GUYER S Z, MCKINLEY K S, FRAMPTON D. Free-me: a static analysis for automatic individual object reclamation [C]∥ACM SIGPLAN Conference on Programming Language Design and Implementation. New York, USA: ACM, 2006: 364-375.
CHEREM S, RUGINA R. Uniqueness inference for compile-time object deallocation [C]∥6th International Symposium on Memory Management. New York, USA: ACM, 2007: 117-128.
LEE O, YI K. Experiments on the effectiveness of an automatic insertion of memory reuses into XSML-like programs [C]∥The 3rd International Symposium on Memory Management. New York, USA: ACM, 2004: 97-108.
VIVIEN F, RINARD M. Incrementalized pointer and escape analysis [C]∥ACM SIGPLAN Conference on Programming Language Design and Implementation. New York, USA: ACM, 2001: 35-46.