According to Oracle Docs Run-Time Data Areas states, JVM contains various parts of data areas:
And I also learnt that JVM is stack-based and ART/Dalvik is register-based. Dalvik heap is made of Active Heap and Zygote Heap.
Questions are as following:
1. What is the difference between "Stack" in stack-based and "Stack" in Java VM stack/Native Method Stack.
2. Does ART/Dalvik contain stacks like Java VM stacks in JVM?
3. What do ART/Dalvik Run-Time Data Areas look like?
- What is the difference between "Stack" in stack-based and "Stack" in Java VM stack/Native Method Stack.
They refer to the same thing. A "stack based" VM uses the stack
of its memory space in order to carry out logical and arithmetic operations.
Does ART/Dalvik contain stacks like Java VM stacks in JVM?
The Android VM implementation (both Dalvik and ART) are not Stack based
, but instead Register based
. One thing this allows Android to do is directly map virtual registers to real hardware registers, which improves execution speed and efficiency.
- What do ART/Dalvik Run-Time Data Areas look like?
You can see an example of this, and read more about stack-based vs register-based VMs here.