The composition of the JDK

The composition of the JVM

The runtime data area is the MEMORY model of the JVM.

The virtual machine stack

The local method stack is similar to the virtual machine stack, but the difference will be discussed later.

Methods area

  • Used to store data such as class information, constants, static variables, and just-in-time compiled code that have been loaded by the virtual machine.

(1) shared by threads; (2) Runtime constant pool;

  • Holds various literal and symbolic references generated at compile time.
  • In addition to the Class file contains the version of the Class, fields, methods, interfaces, and other description information.

Static is pretty much in there.

Broadly speaking

  • A local variable in a stack frame may be an object, and there will be a reference to the corresponding object in the heap.
  • Static variables in a method area can also be objects, and there will be references to corresponding objects in the heap.
  • The program counter holds a reference (address) to where the method area instruction is executed.
  • The program execution engine executes the instruction code according to the program counter.
  • As we all know, objects are in the heap.