The Structure ofthe Java Virtual MachineEach Java Virtual Machine thread has aprivate Java Virtual Machine stack,created atthe same timeasthe thread.
A Java Virtual Machine stack stores frames (§2.6).
language such as C: it holds local variables and partial results,
and plays a part in method invocation andreturn.
to push and pop frames,frames may be heap allocated.
The memory fora Java Virtual Machine stack does not need to be contiguous.
Java Virtual Machine may use conventional stacks, colloquially called
"C stacks," to support native methods (methods written in a language
other than the Java programming language). Native method stacks may
Machine's instruction setin a language such as C. Java Virtual Machine
rely on conventional stacks need not supply native method stacks.
If supplied, native method stacks are typically allocated per
thread wheneach thread is created.
thatis shared among all Java Virtual Machine threads.
The heap istherun-time data area from which memory for all class
instances and arrays is allocated.The heap is created on virtual
machine start-up.Heap storage for objects is reclaimed by an automatic
storage management system (known as a garbage collector);
objects are never explicitly deallocated. The Java Virtual Machine assumes no
particular type of automatic storage management system, andthe storage
management technique may be chosen according tothe implementor's
system requirements. The heap may be of a fixed size or may be
expanded as required bythe computation and may be contracted if a
larger heap becomes unnecessary. The memory forthe heap doesnot
need to be contiguous.