JVM memory areas
Memory-wise, JVM is made up of two major generic storage types: stack and heap.
The JVM stack and native stack
A stack is a last in, first out (LIFO) type of storage. For each JVM thread of execution, there is a JVM stack. In this stack, entries called frames are stored. The frames can hold object references, variables values, and partial results. During the execution of a Java application, these frames are added (push) to, or removed (pop) from the JVM stack.
In JVM, there is also the concept of a native stack. Normally, there exists one stack per JVM thread, and it is used to support native (written in a platform-native language such as C/C++) functions/methods as the regular JVM stacks can't hold them.
As a concept, a stack is quite easy to control. When a frame is no longer needed, it gets removed (pop), and its memory area is freed by the simple operation of adjusting a pointer to the next frame in the stack.
The heap
The heap is a memory area that, according to the specification...