What is the JVM?

The JVM is Java Virtual Machine (Java)The virtual machineThe JVM is a specification for computing devices. It is an imaginary computer that is implemented by emulating various computer functions on an actual computer.

With the introduction of Java language virtual machines, the Java language does not need to be recompiled when running on different platforms. The Java language uses the Java virtual machine to mask platform-specific information, making the Java languagecompilerSimply generate object code that runs on the Java virtual machine (The bytecode), can run unmodified on multiple platforms.

 

1. Memory model and partition, what should be placed in each partition in detail?

The JVM is divided into heap and stack areas, as well as method areas, where initialized objects are placed on the heap and references are placed on the stack,

The class information constant pool (static constants and static variables) is placed in the method area.

new:

Method area: mainly stores class information, constant pool (static constants and static variables), compiled code (bytecode) and other data.