임베디드 자바 가상머신에서의 가비지 컬렉션

Garbage Collection on the Embedded Java Virtual Machine

  • 이상윤 (한국전자통신연구원 임베디드S/W연구단) ;
  • 김상욱 (한양대학교 정보통신대학 정보통신학부) ;
  • 최병욱 (한양대학교 정보통신대학 정보통신학부)
  • Lee Sang-Yun (Embedded S/W Research Division, Electronics and Telecommunications Research Institute) ;
  • Kim Sang-Wook (Division of Information and Communications, Hanyang University) ;
  • Choi Byung-Uk (Division of Information and Communications, Hanyang University)
  • 발행 : 2006.05.01

초록

자바 언어는 그 객체지향성, 안전성, 유연성으로 인하여 현재 가장 널리 쓰이는 프로그래밍 언어의 하나가 되었으며, 자바 가상머신이 제공해주는 가비지 컬렉터로 인하여 프로그래머는 메모리 관리에 관한 많은 고민이 줄어들었다. 임베디드 환경에서 역시 자바는 강세를 나타내고 있으며 임베디드 환경의 특성을 반영한 가상 머신과 가비지 컬렉션 기법이 요구되고 있다. 본 논문에서는 힙이라고 불리는 메모리 영역을 크게 젊은 세대와 늙은 세대의 두 부분으로 나누어서 관리하며 각 세대는 그 특성과 요구사항에 적합하도록 각기 다른 기법을 적용한 가비지 컬렉터를 제안한다. 더불어 효과적인 가비지의 식별을 위한 쓰기 장벽과 2중 필터링 기법을 제안하고 있으며, 일반적인 방법으로 회수가 불가능한 순환적 구조의 가비지를 검출하여 회수하기 위한 이중 검사 기법을 제안한다. 제안하는 기법은 임베디드 환경의 요구사항인 객체의 빠른 할당, 동작의 실시간성, 모든 가비지의 회수, 단편화 제거, 높은 지역성 등을 모두 만족한다.

The Java language has been established as one of the most widely used language due to its object-oriented programming, safety and flexibility and the garbage collection of the virtual machine has relieved programmers of many difficulties related to the memory management. In the embedded environment, Java is also prevalent, the virtual machine and garbage collector that takes into account the embedded environment is required. In this paper we manage the heap memory area by dividing into young generation and old generation, and we propose a garbage collector in which appropriate techniques are applied to each generation to utilize the different characteristics of each generation. Also, we propose the write barrier technique and double filtering technique for efficient garbage recognition, and double check method for determining and reclaiming the garbage with cyclic structure. The proposed method satisfies the embedded environment's requirements of fast object allocation, real time property, recollection of all the garbage, elimination of fragmentations and high locality.

키워드

참고문헌

  1. D. A. Barrett and B. G. Zorn, Using lifetime predictors to improve memory allocation performance, In Proceedings of SIGPLAN Conference on Programming Languages Design and Implementation(PLDI), Vol. 24, No. 7, pp. 187-196, June 1993 https://doi.org/10.1145/155090.155108
  2. S. M. Blackburn, P. Cheng, and K. S. McKinley, Myths and reality: The performance impact of garbage collection, In Proceedings of International Conference on Measurement and Modeling of Computer Systems, pp. 25-36, June 2004 https://doi.org/10.1145/1005686.1005693
  3. C. J. Cheney, A non-recursive list compacting algorithm, Communications of the ACM,. Vol. 13, No. 11, pp. 677-678, Nov. 1970 https://doi.org/10.1145/362790.362798
  4. Sun Microsystems, Java2 Platform, Micro Edition, Connected Device Configuration(CDC), http://java.sun.com/products/cdc/index.jsp 2005
  5. R. E. Jones and R. Lines, Garbage collection: Algorithms for automatic dynamic memory management, Wiley, Chichester, July 1996
  6. H. Lieberman and C. E. Hewitt, A real-time garbage collector based on the lifetimes of objects, Communications of the ACM, Vol. 26, No. 6, pp. 419-429, 1983 https://doi.org/10.1145/358141.358147
  7. W. Liu, Z. Chen, and S. Tu, Research and analysis of garbage collection mechanism for real-time embedded java, In Proceedings of International Conference on Computer Supported Cooperative Work in Design, pp. 462-468, May 2004
  8. D. M. Ungar, Generation scavenging: A non-disruptive high performance storage reclamation algorithm,' ACM SIGPLAN Notices, Vol. 19, No. 5, pp. 157-167, Apr. 1984 https://doi.org/10.1145/390010.808261
  9. B. G. Zorn, Comparative performance evaluation of garbage collection algorithms, PhD thesis, University of California at Berkeley, Technical Report UCB/CSD 89/544, Mar. 1989
  10. B. Zorn, Barrier methods for garbage collection, University of Colorado, Technical Report CU-CS-494-90, Nov. 1990
  11. C. J. Cheney, A non-recursive list compacting algorithm, Communications of the ACM, Vol. 13, No. 11, pp. 677-678, Nov. 1970 https://doi.org/10.1145/362790.362798
  12. Tim Lindholm and Frank Yellin, The JavaTM Virtual Machine Specification (second edition). Addison-Wesley. 1999
  13. G. Chen et al., Tuning garbage collection in an embedded Java environment, In Proceedings of International Symposium on High-Performance Computer Architecture, pp. 92-103, Feb. 2002
  14. CDC reference implementation 1.1 corresponding to JSR 218, http://java.sun.com/products/cdc/index.jsp
  15. D. $Stefanovi\`{c}$, M. Hertz, S. M. Blackburn, K. S. McKinley, J. Eliot B. Moss , Older-first garbage collection in practice: evaluation in a Java Virtual Machine, ACM SIGPLAN Notices , MSP '02, Vol. 38 No. 2, pp. 25-36, June. 2002 https://doi.org/10.1145/773039.773042
  16. D. Stefanovic, K. S. McKinley, J. Eliot B. Moss, Age-based garbage collection, ACM SIGPLAN Notices, OOPSLA '99, Vol. 34 No. 10, pp. 370-381, October 1999 https://doi.org/10.1145/320385.320425
  17. L. T. Hansen, W. D. Clinger, An experimental study of renewal-older-first garbage collection, ACM SIGPLAN Notices , ICFP '02, Vol. 37 No. 9, pp. 247-258, September 2002 https://doi.org/10.1145/583852.581502