-
What is a virtual machine?
It is the software that simulates the architecture of a certain computer and executes a specific set of instructions. For example: VMware
The JVM is a process virtual machine, and he does not emulate the operation of an operating system. Just provide a specific set of instructions.
In the Java Virtual Machine specification, you define the areas in which different types of data are stored during the run of a program.
-
Partition of the run-time data area.
Program counter Java heap Java Virtual machine stack local method stack method area
Program counter: A small amount of memory space whose function can be seen as the line number indicator of the byte code executed by the current thread.
It is thread-private, if the execution of a Java method, then the counter record is the address of their own instructions, if the native method then the value of the counter is empty.
Local method Stack: Thread-Private, LIFO, the function is to support the call of the native method, execution exits. OutOfMemoryError and Stackoverflowerror exceptions may occur.
About automatic memory management for Java