JVM’s structure
The structure of the JVM can be described in terms of its runtime data structure in memory and the two subsystems that use the runtime data – the classloader and the execution engine.
Runtime data areas
Each of the runtime data areas of JVM memory belongs to one of two categories:
- Shared areas, which include the following:
- Method area: Class metadata, static fields, and method bytecode
- Heap area: Objects (states)
- Unshared areas that are dedicated to a particular application thread, which include the following:
- Java stack: Current and caller frames, with each frame keeping the state of Java (non-native) method invocation:
- Values of local variables
- Method parameter values
- Values of operands for intermediate calculations (operand stack)
- Method return value (if any)
- Java stack: Current and caller frames, with each frame keeping the state of Java (non-native) method invocation:
- PC register: The next instruction to execute
- Native method stack: The state of the native method invocations
We have already discussed that a programmer must be careful...