본문 바로가기

Programming Theory/JVM

JVM Runtime Data Area

1. JVM Runtime Data Area

구분 

 구성

설명 

 thread별

 JVM stack

 '2. JVM stack'에서 상세설명

 PC Register

 PC - Program Counter

 현재 실행되고 있는 JVM instrunction 의 주소를 가진다.

 Native Method Stack

 JNI (Java Native Interface) 에 의해 invoke 된 C/C++(java 가 아닌 다른 언어) 의 execute code stack  

 thread공통

 Heap

 instance 와 objects 를 저장하는 공간

 '4. Heap Space' 에서 상세설명

 Method Area

 '3. Method Area'에서 상세설명


2. JVM stack


JVM 에서 method 가 실행되면, JVM 에서는 JVM stack 에 stack frame(struct)를 push 또는 pop한다. 


stack frame 의 구성

구성 

 설명

 Local Variable Array

 index 0 : executed 된 method 가 속한 class instance reference

 index 1~parameter 의 개수 : method 의 parameters

 나머지 index : method 의 local variables

 Operand Stack 

 operand : 피연산자 (data)

 Reference of Runtime Constant Pool 

 method 가 속해있는 class 의 Runtime Constant Pool 의 reference

method 가 실행될 때 stack frame 항목의 데이터를 read/write 한다.


3. Method Area

Oracle HotSpot JVM 에서는 Permanent Generation(permgen) 또는 Permanent Area 라고 부른다.

구성 

 설명

 Runtime Constant Pool

 constant of class, interface

 method, field 에 memory reference

 method/field 에 관한 정보

 

 static fields

 

 method 의 bytecode 

 


출처 : http://www.cubrid.org/blog/dev-platform/understanding-jvm-internals/

'Programming Theory > JVM' 카테고리의 다른 글

Garbage Collection  (0) 2016.08.21