자바 프로그램에서 메모리 영역 간 자료 이동에 따른 부담 분석

Analysis of Data Transfer Overhead Among Memory Regions in Java Program

  • 발행 : 2008.05.15

초록

자바 프로그램이 실행되면서 자료들은 상수에서 변수로, 변수에서 변수로 등 다양한 경로로 이동한다. 자료들은 메모리에 위치하며 자료의 이동은 메모리에 대한 접근을 필요로 한다. 메모리 접근은 시간지연과 에너지 소비를 야기하므로 여러 경로의 자료 이동이 어떤 부담을 갖는지를 아는 것은 효율적 프로그램 작성은 물론 고성능 자바가상기계의 구현에도 필수적이라 할 수 있다. 본 논문에서는 자바 메모리를 상수, 지역변수, 필드 등 세 가지 영역으로 나누고 각 영역 간의 자료 이동에 대한 부담을 조사하였다. 분석 결과 지역변수에서 지역변수로의 자료 이동이 가장 부담이 작고 필드에서 필드로의 이동이 가장 부담이 큰 것으로 조사 되었으며 부담 차이는 최대 2배에 이르는 것을 발견하였다. JIT 등 최적화 기술은 자료 이동 부담을 현저히 감소시켰으며 HotSpot JVM의 경우 최소 14배에서 최대 27배까지 부담 저하 효과를 나타내었다.

Data transfers occur during the execution time of a Java program, from constant to variable, from variable to other variable and so on. Data are located in memory and hence data transfer requires access to memory. As memory access generates both time delay and energy consumption it is absolutely necessary to know the data transfer overheads incurred among different paths not only to write an efficient program but also to build a high-performance Java virtual machine. In this paper we classify Java memory into three different regions, constant, local variable, and field, and then investigate data transfer overheads among these regions. The result says that the transfer between local variables incur the least overhead usually, while the transfer between fields incur the most. The difference of overheads reaches up to a double. Optimization techniques like JIT reduces the data transfer overhead dramatically. It is observed that the overhead is reduced from 14 to 27 times for the case of Hotspot JVM.

키워드

참고문헌

  1. R. Banakar, S. Steinke, B.-S. Lee, M. Balakrishnan, and P. Marwedel, "Scratchpad Memory : A Design Alternative for Cache On-chip memory in Embedded Systems," Proc. of the 10th International Workshop on Hardware/Software Codesign (CODES'02), 2002
  2. V. De La Luz, M. Kandemir, and I. Kolcu, "Automatic Data Migration for Reducing Energy Consumption in Multi-Bank Memory Systems," Proc. Design Automation Conf. (DAC'02), 2002, pp. 213-218
  3. M. Mamidipaka and N. Dutt, "On-chip Stack Based Memory Organization for Low Power Embedded Architectures," Proc. Design, Automation and Test in Europe (DATE'03), 2003, pp. 1082-1087
  4. Zoe C.H. Yu, Francis C.M. Lau, and Cho-Li Wang, "Exploiting Java Objects Behavior for Memory Management and Optimizations," Lecture Notes in Computer Science, Springer, Volume 3302, 2004, pp. 437-452
  5. T. Lindholm and F. Yellin, The Java Virtual Machine Specification, Addison Wesley, 1999
  6. T. Cramer, R. Friedman, T. Miller, D. Seberger, R. Wilson, and M. Wolczko, "Compiling Java just in time," IEEE Micro, Vol.17, No.3, May-June 1997, pp. 36-43 https://doi.org/10.1109/40.591653
  7. J. Engel, Programming for the Java Virtual Machine, Addison Wesley, 1999
  8. RTJ Computing Pty. Ltd., The Simple Real-Time Java, http://www.rtjcom.com/
  9. Sun Microsystems, The Java HotSpot Virtual Machine, Technical White Paper, Sept 2002
  10. IBM, WebSphere Everyplace Micro Environment, April 2006
  11. 양희재, "에너지 관점에서 임베디드 자바가상기계의 메모리 접근 형태", 한국정보처리학회 논문지, 12-A권 3호, 2005. 6. pp. 223-228 https://doi.org/10.3745/KIPSTA.2005.12A.3.223
  12. H. Oi, "On the Design of the Local Variable Cache in a Hardware Translation-Based Java Virtual Machine," Proc. ACM SIGPLAN/SIGBED Conf. on Languages, Compilers, and Tools for Embedded Systems, 2005, pp. 87-94
  13. G. Chen, et al., "Tuning Garbage Collection in an Embedded Java Environment," Proc. of the Int'l Symposium on High-Performance Computer Architecture, 2002
  14. G. Chen, et al., "Adaptive Garbage Collection for Battery-Operated Environments," Proc. of USENIX JVM '02 Symposium, 2002, pp. 1-12
  15. C. Ananian and M. Rinard, "Data Size Optimizations for Java Programs," Proc. ACM SIGPLAN Conf. on Language, Compiler, and Tool Support for Embedded Systems, 2003, pp. 59-68