Escape Analysis for Stack Allocation in Java

자바 객체의 스택 저장 가능성 판별을 위한 정적 분석 기법

  • 조은선 (충북대학교 전기전자컴퓨터학부)
  • Published : 2004.06.01

Abstract

Garbage collecting objects in Java makes memory management easier for the programmer, but it is time consuming. Stack allocation may be an alternative which identifies stack-allocatable objects before the execution, without performance degradation. We suggest an escaping analysis recording the interprocedural movement of the method, to detect an object the method of whose creation may have been already deactivated during the access. Our approach is different from prior works, enables us to handle some cases that are missed in the previous variable - oriented approach.

자바에서 사용이 끝난 객체의 수집(garbage collection)은 프로그래머의 메모리 관리 부담을 덜어준다는 장점이 있다. 그러나, 수행 속도에 영향을 미치게 되므로 정적 분석 기법을 사용하여 이를 극복하는 기법이 제안되어왔다. 이 중 하나인 스택 저장 기법은, 힙메모리 대신 메소드 스택에 저장될 수 있는 객체들을 수행 전에 분석하여 파악해두는 방식을 따른다. 본 논문에서는 메소드의 호출/반환에 대해 직접 분석하여 자신을 생성한 메소드의 반환 후에도 접근될 소지가 있는 객체들을 판별하는 정적 분석 기법을 제시한다. 이로써 객체와 변수의 지정(assignment) 관계 분석을 기준으로 하는 기존의 스택 저장 기법들에서 간과되었던 객체들 중에서도 스택에 저장할 수 있는 대상을 발견할 수 있도록 한다.

Keywords

References

  1. B. Blanchet. 'Escape analysis for object oriented languages application to java,' In Proc. of the ACM OOPSLA Conf., 1999 https://doi.org/10.1145/320384.320387
  2. J-D. Choi et. al, 'Escape Analysis for Java,' In Proc. of the ACM OOPSLA Conf., 1999 https://doi.org/10.1145/320384.320386
  3. J. Whaley and M. Rinard. 'Compositional Pointer and Escape Analysis for Java Programs,' In Proc. of the ACM OOPSLA Conf., 1999 https://doi.org/10.1145/320384.320400
  4. P. Cousot and R. Cousot. 'Abstract interpretation : a unified lattice model for static analysis of programs by construction of approximation,' In Proc. of SIGPLAN Conf. on Principle of Programming Languages, 1977 https://doi.org/10.1145/512950.512973
  5. P. Cousot and R. Cousot. 'Abstract interpretation frameworks,' Journal of Logic and Computation, 2(4), 1992 https://doi.org/10.1093/logcom/2.4.511
  6. W. L. Harrison, 'The Interprocedural Analysis and Automatic Parallelization of scheme Programs,' Lisp and Symbolic Computation, 2(3):179-396, 1989 https://doi.org/10.1007/BF01808954
  7. T. Lindholm and F. Yelline, 'The JavaTM Virtual Machine Specification-2nd edition,' Addison-Wesley, 1999
  8. A. Deutsch, 'On the Complexity of Escape Analysis,' In Proc. of the ACM symposium on principles of Programming Languages(POPL), 1997 https://doi.org/10.1145/263699.263750
  9. B. Blanchet, 'Escape Analysis: Correctness Proof, Implementation and Experimental Results,' In Proc. of the ACM symposium on principles of Programming Languages (POPL), 1998 https://doi.org/10.1145/268946.268949
  10. A. Deutsch, 'On Determining lifetime and aliasing of dynamically allocated data in higher-order functional specifications,' In Proc. of the ACM symposium on principles of Programming Languages (POPL), 1990 https://doi.org/10.1145/96709.96725
  11. P. Cousot and R. Cousot, 'Modular Static Program Analysis,' in Proc. of the Eleventh International Conference on Compiler Construction (CC 2002), 2002
  12. E.-S. Cho, K. Yi, 'Escape Analysis for Stack Allocation in Java,' ECOOP workshop on Formal Techniques for Java Programs, 2000