jvm (a): Why learn a virtual machine

Like many others, I came into contact with a Java virtual machine just because the interview need to use, so bite the bullet and take a look. Why do so many people want to learn for the virtual machine this problem, their answer is: because the interview. But I passed a few years of study and combat, I find that learning is not just a virtual machine that interview, but in a deeper understanding of the language Java, as well as lay the foundation for future online troubleshooting problems.

First talk about my first point: to learn Java virtual machines in-depth understanding of the Java language. Just work for a year or two friends, each API did not use cooked, naturally not go in-depth study of the various details of Java. But for the work of the next three friends, a lot of time to solve a problem you have to go deep into the bytecode level analysis, you can get accurate conclusions, but that is part of the bytecode virtual machine.

For example, we used Boolean Boolean, we all know that it has two values, true and false. But you know that in fact at runtime, Java Virtual Machine is no Boolean Boolean this type. Integer Boolean type used in the virtual machine 1 and 0 represent.

For example, we all know that the class path and class name uniquely identifies a class, but in fact not the case. Or, as we say in conclusion only on the surface. If you go deep into the virtual machine level, the class loader class path, the only decision before the class name of a class. That is, if two different class loaders load them with a class class files, and that these two classes loaded class is different.

There are many examples like this. Learn Java learn at this level, if you do not understand some of the basics of the virtual machine, then it is hard to understand some of the details in depth.

Then I want to talk to my second point: the virtual machine learning is the foundation for online troubleshooting. We know that we deploy a Java application on the online machine, certainly from time to time problems. Removal of problems of their own networks, systems, problems often Java applications, the Java virtual machine memory is a problem. Either out of memory, and either GC frequent cause slow response and so on.

How then to solve these problems? First, you must learn to read the log it. Then you have to be able to understand GC log, which is part of the Java virtual machine content. GC logs you read, then you have to understand what the young generation, old time, permanent generations, metadata area, etc., these are the Java virtual machine memory model. Do you understand the Java virtual machine memory model, then you have to know how the Java virtual machine garbage collection, the garbage collection algorithm they use is like, what their advantages and disadvantages. Then there is the characteristics of the various garbage collector.

You see, all these things are associated. You want to solve the Java application crashes online, then you must learn to GC logs. GC logs to understand, we must learn the Java virtual machine memory model. To understand the Java virtual machine memory model, you must learn to garbage collection and so on.

Having to learn why a virtual machine, then I want to say why I write this column.

Perhaps in others it seems, the virtual machine market information has been very enriched. Type of theory, you can see Zhou Zhiming teacher "in-depth understanding of the Java Virtual Machine." Type of combat, you can see Ge Yiming teacher's "real Java virtual machine." I do not seem reasonable to write the same content, there will be overlap wrote most of the content. At first I thought the same thing, but then I found on some knowledge to understand the point, I have my own understanding, I hope to share with you. While inevitably there will be some overlapping areas, but not the same as writing ideas for people is not the same, meaning naturally not the same.

Compared to "in-depth understanding of the Java Virtual Machine" and "actual combat Java Virtual Machine," I should write some of the more shallow and easier to see some knowledge. This column will be a logical way to write clues, that the source code, bytecode, native code, loaded into memory, garbage collection this perspective to write and talk about all of this knowledge center involved. In this way, relatively speaking more logical, more able to have all the knowledge points in series. Hope in a logical way to string together all the knowledge points, so that we better understand, let beginners not only know this stuff, but also know why.

After determining want this thing, I'm two months ago began to prepare, 6:00 every morning to get to see the books, beginning with handwritten first draft. But to write a column in simple terms is not easy, sometimes too demanding but easy to make the article died giving birth. As I write this, I have roughly manager clearly article chapter to write, but the content is still not very clear. But I know that if I do not send out, or maybe there will never be a issue. Because written too long, perhaps never finish the drag too. Sometimes too pursuit of perfection, but not a good thing. Therefore, we welcome more than make a suggestion when looking at to help me improve the article.

If you are interested in me, that I can look at the follow-up article hair. If you have friends on the Java Virtual Machine interested, you can also forwarded to them, inviting them to learn to pull together.

Guess you like

Origin www.cnblogs.com/dtdyq/p/11995336.html