|
Answer» The following are the several types of MEMORY spaces allocated by the Java Virtual Machine: - The Class(Method) Area: The Class(Method) Area keeps TRACK of per-class structures such as the RUNTIME constant pool, fields, method data, and method code.
- Program COUNTER (PC) Register: The PC (program counter) register stores the address of the Java virtual machine instruction CURRENTLY being executed.
- Stack: Frames are kept in the Java Stack. Local variables and partial results, as well as invoking and returning methods, are all managed by it. Each thread has its own JVM stack, which is created at the same time as the thread. A new frame is created each time a method is called. When the method invocation of a frame is complete, it is destroyed.
- The Native Method Stack: The Native Method Stack contains every single native method utilized in the application.
- Heap: This is where the objects' memory is allocated during runtime.
|