Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the brief introduction of JVM?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about the brief introduction of JVM, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Talk about JVM.

JVM, a familiar and unfamiliar term, will be heard from the first day we know Java. In the first year or two of the job, we are often asked about the difference between JDK,JRE,JVM and job interviews.

JVM can be said to be old friends with us, but the application scenarios at work may not be as good as those frameworks, but at critical times, we still have to rely on it to solve the problem. As the saying goes, only by knowing ourselves and the enemy can we be invincible. JVM as a hurdle to a senior engineer, from this article, we will gradually analyze, explain, and conquer this mountain.

What is JVM?

JVM (Java Virtual Machine), translated into Chinese, is the Java virtual machine. As we all know, the Java language has a very distinct feature, and it is also one of the slogans of the early Java development.

Write Once Run Everywhere

"write once, run everywhere", I believe that as Java developers, we are no stranger to this sentence, the strength of this sentence comes from our JVM.

Image-20190725222020573

The principle is that the source program java files we write are compiled into bytecode files (files with the suffix class) that can be recognized by JVM, and running everywhere depends on the implementation of different virtual machines for different platforms.

Java's programs run on JVM, not directly on CPU.

Learning essentials of JVM

First of all, we need to know that as a virtual machine, we must have its own memory mechanism, so we must understand its memory mechanism, including memory structure, garbage collection mechanism and so on.

Secondly, we need to know that the source code we wrote has been translated into a bytecode file (because of its suffix class, so it will also be called a class file), for the structure of this file, we must have some understanding of the structure of this class, for some concurrency and multithreading knowledge can be insightful, know why.

Before entering the virtual machine to execute, the bytecode file will go through a series of processes. Our mechanism for this process is generally called class loading mechanism. When this class is loaded into JVM, in the process of running, there will be a series of instructions to help the program achieve the final goal.

In fact, all of what has been said above is to help us have a better understanding of what happens in the execution process of java files. When we encounter problems, we can get to the bottom of the problem, but in our daily work, we will not or certainly not read the bytecode files we have written. What we care about is how to use tools to tune. To maximize the value of the lowest cost, through the tuning of JVM to improve the robustness of our program.

A supplement to JVM

Although JVM is called Java Virtual Machine, it should be noted that with the development and growth of Java, more and more languages have been added to the JVM ecology, such as Groovy,Scala,Kotlin, which we are familiar with, they are all based on the JVM platform, and the compiled files are all bytecode files with the suffix class.

The above is the brief introduction of JVM. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow 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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report