In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what are the characteristics of JVM", the content is simple and easy to understand, and the organization is clear. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "what are the characteristics of JVM".
1. Virtual machine concept
Virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. What can be done in a physical computer can be done in a virtual machine. When creating a virtual machine in a computer, you need to use part of the hard disk and memory capacity of the physical machine as the hard disk and memory capacity of the virtual machine. Each virtual machine has its own CMOS, hard disk, and operating system, and can be operated as if it were a physical machine.
2. JVM virtual machine
JVM stands for Java-Virtual-Machine, or Java Virtual Machine. JVM is a specification for computing devices. It is an imaginary computer that is implemented by simulating various computer functions on an actual computer.
3. JVM characteristics
First of all, compiling everywhere is something that everyone knows about learning Java language. In fact, it is not Java language cross-platform, but JVM cross-platform. Jvm runtime does not execute Java files, but executes compiled.class files.
bytecode
Bytecode files are binary files that JVM can recognize and execute. Different programming languages are compiled by compiler and converted into unified bytecode specification files, so that JVM can execute them.
cross-platform
The cross-platform feature is that JVM virtual machines can run on different computer systems, such as Linux systems, MacOS systems, Win systems, which are often used.
cross-language
With the continuous development and optimization of JVM, many languages rely on the ability of JVM. After various programming languages are compiled and converted into bytecode files, JVM can recognize them. This is also the reason why business programming under Java system is often mixed with languages.
Note: The current and subsequent Jvm series articles are based on HotSpot-VM and JDK version 1.8 +.
II. Virtual machine structure
The overall structure of Jvm is roughly as follows:
1. Class Loader
The class loader is used to load Java classes into the JVM virtual machine. The source code program.java file is converted into a byte code.class file after compilation by the compiler. The class loader is responsible for reading the byte code and converting it into an instance of the java.lang.Class class.
2. Runtime data area
metadata area
JDK 1.8, formerly known as Method-Area, stores class information, constants, static variables, code compiled by the JIT compiler, and other data that has been loaded by the virtual machine.
heap region
An area of memory shared by all threads and created at virtual machine startup to hold object instances.
JVM stack
You can refer to the data structure of the stack to store the memory model executed by Java methods. In Java development, a function implementation requires multiple subroutine methods to cooperate. When the program is executed, it jumps to the subroutine and stores the address of the next instruction in the stack. After the subroutine is executed, the address is taken out and returned to the original program.
native method stacks
The native method stack functions similarly to the virtual machine stack, serving when the JVM calls native methods.
program counter
A relatively small block of memory that acts as a line number indicator of the bytecode being executed by the current thread.
3. Execution engine
Java virtual machine is the core component, input is bytecode, processing process is bytecode parsing, output execution results.
III. Life cycle
The JVM life cycle here refers to the period when the JVM executes Java programs:
Start-up initialization: start-up through the boot class loader to create initial classes complete;
Program execution: Start with the main method and execute the Java program until the program is finished;
Virtual machine exit: the normal execution of the program ends, or an exception, error, etc. causes termination, you can also call the exit method;
IV. HotSpot Virtual Machine
HotSpot is the most used virtual machine in Java architecture, it combines the latest memory model, garbage collector and adaptive optimizer to provide the best performance for Java applications using many advanced technologies.
The main reason is that most Java runtime environments rely on HotSpot virtual machines.
The above is all the contents of this article "What are the characteristics of JVM?" Thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.