Java Virtual Machine---memory
Javavirtual machines, i.e.JVM, responsible for runningJavaprograms, eachJavaprograms are run in a specificJVMinstance. Javathe architecture of virtual machines is divided into: class loading subsystem, runtime data area, execution engine. The class loading subsystem is responsible for loading, validating, parsing, initializing the Java class System; the Java Virtual machine needs to store a lot of data when running a program, such as class loading information, created instance object, parameter of method call, local variable, intermediate value, etc., the virtual machine stores this information in the "Runtime data area". That is, the JVM memory that is spoken here; the execution engine is the input of the class file in bytecode form, and the running program outputs the calculation result.
Java Virtual machine memory is a conceptual thing, the official does not give a specific implementation, knowledge gives a standard or specification, each Java Virtual machine manufacturers can design their own virtual machine according to this specification, the user can also set the size of each part of the memory through the instruction set.
JVM memory consists of several areas: The method area, the heap, the Java stack, the PC storage area, and the local method stack.
Method Area: Store class information, constants, static variables, compiled bytecode, all threads shared
Heap: Store Instance object information, shared by all threads
Java stack: The state of a method call, stored as a stack frame in the form of parameter passing, local variables, calculation of intermediate values and other information, return address, each thread a
PC Register: Point to the next instruction to be executed, one for each thread
Local method Stack: similar to the Java stack, except that the Java stack provides a service to the virtual machine to execute the Java method, while the local method stack provides a service for the virtual machine to perform the local method
Java Virtual Machine---memory