Java Virtual Machine is one of the most important components which does particular types of work.
- Loading of code
- Verification of code
- Executing the code
- Providing a run-time environment for the users
All these functions take different forms of the memory structure. These data structures are:
- Program Counter Register
- Native Method Stack
Let us discuss each of the above memory structures' characteristics:
Heap memory structure is usually implemented for allocating memory dynamically. Variables assigned with this type of memory structure can be allocated at runtime, but they have slow accessing of memory.
Stack memory structure is mostly implemented for providing static memory allocation. Programmers could make use of stack if they knew in advance how much memory needs to be allocated for the storage of data.
Program Counter Register: Programs are a set of instructions or orders feed to a computer for performing. These instructions are delivered to the processor by the program written by a human. Program counter register holds the address of the upcoming instructions to be executed.
Native methods form a stack that is primarily implemented to line up with your system calls as well as libraries scripted in different computer language.
Here are few other related articles for you to read: