DOI QR코드

DOI QR Code

EVM에서의 자바 동적 메모리 관리기 및 쓰레기 수집기의 구현 및 성능 분석

Implementation and Performance Analysis of the EVM's Java Dynamic Memory Manager and Garbage Collector

  • 이상윤 (한국전자통신연구원 임베디드S/W연구단) ;
  • 원희선 (한국전자통신연구원 임베디드S/W연구단) ;
  • 최병욱 (한양대학교 정보통신대학 정보통신학부)
  • 발행 : 2006.08.01

초록

자바 언어는 객체지향성, 안전성, 유연성으로 인하여 현재 가장 널리 쓰이는 프로그래밍 언어의 하나가 되었으며, 자바 가상머신이 제공해주는 메모리 관리기 및 가비지 컬렉터로 인하여 프로그래머는 메모리 관리에 관한 많은 고민이 줄어들었다. 본 논문에서는 임베디드용 자바 가상 머신에서 구현된 메모리 관리기 및 가비지 컬렉터에 대해서 제안한다. 메모리 관리기는 힘을 다양한 크기의 셀로 분할한 후 통일한 셀의 집단인 블록 단위로 관리하여 빠른 메모리 할당과 해제가 가능하다. 가비지 컬렉션 방법으로는 3-색상 기반 표기-쓸어담기 가비지 컬렉터를 기반 알고리즘으로 채택하였으며 멀티쓰레드를 지원하기 위해 새로운 4-색상 기반 표기-쓸어 담기 가비지 컬렉터를 제안한다. 제안하는 기법은 메모리 단편화가 발생하지만 객체 생성수가 많아짐에 따라 단편화율이 거의 일정함을 실험을 통해 보인다.

Java has been established as one of the most widely-used languages owing to its support of object-oriented concepts, safety, and flexibility. Garbage collection in the Java virtual machine is a core component that relieves application programmers of difficulties related to memory management. In this paper, we propose a memory manager and a garbage collector that is implemented on a embedded java virtual machine. The memory manager divide a heap into various-sized cells and manages it as blocks of same-sized cells. So it is possible to allocate and free memory fast. We adopted the 3-color based Mark & Sweep garbage collector as our base algorithm and we propose 4-color based Mark & Sweep garbage collector for supporting multi-threaded program. The proposed garbage collector occurs memory fragmentation but we show through a experiment that the fragmentation ratio is almost fixed according as we create objects continuously.

키워드

참고문헌

  1. Sun Microsystems, 'Java2 Platform, Micro Edition, Connected Device Configuration (CDC)', http://java.sun.com/products/cdc/index.jsp, 2005
  2. T. Lindholm, F. Yellin, 'The JavaTM Virtual Machine Specification', 2nd Ed., Addison-Wesley, 1999
  3. 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
  4. 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
  5. 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
  6. 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
  7. www.kaffe.org
  8. Chia-Tien Dan Lo, Witawas Srisa-an and J. Morris Chang, 'Who is collecting your java garbage?,' IT Pro. IEEE Computer Society, pp.44-50, March April, 2003 https://doi.org/10.1109/MITP.2003.1191792
  9. D. Doligez, and X. Leroy, 'A Concurrent, Generational Garbage Collector for a Multithreaded Implementation of ML,' In Proc. 20th ACM Symp. Principles of Programming Languages, ACM Press, pp.113-123, 1993 https://doi.org/10.1145/158511.158611
  10. http://java.sun.com
  11. George E. Collins, 'A method for overlapping and erasure of lists,' Communications of the ACM, Vol.3, No.12, pp.655-657, December, 1960 https://doi.org/10.1145/367487.367501
  12. John McCarthy, 'Recursive functions of symbolic expressions and their computations by machine,' Communications of the ACM, pp.184-195, 1960 https://doi.org/10.1145/367177.367199
  13. Marvin L. Minsky, 'A Lisp garbage collector algorithm using serial secondary storage,' Technical Report Memo 58, Project MAC. MIT, Cambridge, December, 1963
  14. ?Andrew W. Appel, 'Simple generational garbage collection and fast allocation,' Software Practice and Experience, Vol.19, No.2, pp.171-183, 1989 https://doi.org/10.1002/spe.4380190206
  15. E. W. Dijkstra, L. Lamport, A. J. Martin, C. S. Scholten, and E. F. M. Steffens, ' On-the-fly garbage collection: An exercise in cooperation,' Communication of the ACM, Vol.21, No.11, pp.965-975, November, 1978 https://doi.org/10.1145/359642.359655
  16. http://www.gnu.org/software/classpath/