Types of Memory allocated by JVM
Following are the various types of memory areas that are allocated by JVM:
- Class (Method) Area: Stores as class structure. For instance, field, method data, code for methods and runtime constant pool.
- Stack: Frames stores in java stack. Stack also holds partial results and local variables.
- Heap: It is the runtime data area in which the memory is allocated to the objects
- Native Method Stack: Native methods used in the application are stored in the native method stack.
- Program Counter Register: Address of JVM instructions which currently being executed is stored in the program counter register.
Must Read – Access Specifier in Java