Ali architects spent 4 years carefully organizing JVM and sharing core knowledge of performance optimization

JVM is the abbreviation of Java Virtual Machine (Java Virtual Machine). JVM is a specification for computing devices. It is a fictitious computer that is realized by simulating various computer functions on an actual computer.

A very important feature of the Java language is platform independence. The use of the Java virtual machine is the key to achieving this feature. If a general high-level language is to run on different platforms, at least it needs to be compiled into different target codes. After the introduction of the Java language virtual machine, the Java language does not need to be recompiled when it runs on different platforms. The Java language uses the Java virtual machine to shield the information related to the specific platform, so that the Java language compiler only needs to generate the object code (bytecode) that runs on the Java virtual machine, and it can run on multiple platforms without modification. . When the Java virtual machine executes the bytecode, it interprets the bytecode into machine instructions for execution on a specific platform. This is why Java can "compile once, run everywhere".

JVM is generally composed of four parts: ClassLoader, runtime data area, execution engine, and garbage collection. Among them, the runtime data area that we are most concerned about, that is, the memory part of the JVM, is composed of the Method Area, the Java Heap, the JVM Stack, the program counter, and the Native Method Stack. Stack) these parts.

Since the length of the article is too long, small format organized into a PDF document of the JVM performance optimization and analytical consolidation is complete, the way to obtain the document: pay attention to my point here to

Remember to help like and click here after sharing this article !

table of Contents

Comprehensive analysis of JVM and performance optimization from five aspects

1. JVM memory area division

2. JVM execution subsystem

3. Garbage collector and memory allocation strategy

4. Write efficient and elegant Java programs

5. Performance optimization

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-6kBuqLoJ-1609385847055)(//upload-images.jianshu.io/upload_images/22840365-98aa7b014089253f?imageMogr2/auto -orient/strip|imageView2/2/w/640/format/webp)]

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-AJSG3Zsw-1609385847057)(//upload-images.jianshu.io/upload_images/22840365-66150d305d7a7443?imageMogr2/auto -orient/strip|imageView2/2/w/595/format/webp)]

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-rxZ2yrbx-1609385847059)(//upload-images.jianshu.io/upload_images/22840365-534c67efcd74a347?imageMogr2/auto -orient/strip|imageView2/2/w/640/format/webp)]

1. JVM memory area division

1. Program counter (thread private)

2.Java stack (thread private)

3. Local method stack (thread private)

4. Heap (thread sharing)

5. Method area (thread sharing)

6. Direct memory (thread sharing)

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-NIrSVLRT-1609385847061)(//upload-images.jianshu.io/upload_images/22840365-e278184c9c61f1c3?imageMogr2/auto -orient/strip|imageView2/2/w/544/format/webp)]

Two, JVM execution subsystem

1.Class file structure

2. Bytecode instructions

3. Class loading mechanism

4. Class Loader

5.Tomcat class loading mechanism

6. Detailed method call

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-G5iedgXH-1609385847062)(//upload-images.jianshu.io/upload_images/22840365-7c17c79ac1cd3046?imageMogr2/auto -orient/strip|imageView2/2/w/640/format/webp)]

Three, garbage collector and memory allocation strategy

1.Is it passed by value or by reference in Java?

2. Reference type

3. Basic garbage collection algorithm

4. Dispose of garbage by generations

5. Types of garbage collection GC in JAVA

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-590Wr9Xw-1609385847064)(//upload-images.jianshu.io/upload_images/22840365-708576d71b656850?imageMogr2/auto -orient/strip|imageView2/2/w/640/format/webp)]

Fourth, write efficient and elegant Java programs

1. Object-oriented

2. Method

3. General programming

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-6XGsEhLu-1609385847064)(//upload-images.jianshu.io/upload_images/22840365-e84eebfbab958bf9?imageMogr2/auto -orient/strip|imageView2/2/w/640/format/webp)]

Five, performance optimization

1. Commonly used performance evaluation/test indicators

2. Commonly used performance optimization methods

3 Application service performance optimization

(1) Asynchronous

(2) Cluster

(3) Application related

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-9Xgfe3b4-1609385847065)(//upload-images.jianshu.io/upload_images/22840365-ba0b7de680d381ef?imageMogr2/auto -orient/strip|imageView2/2/w/640/format/webp)]

Since the length of the article is too long, small format organized into a PDF document of the JVM performance optimization and analytical consolidation is complete, the way to obtain the document: pay attention to my point here to

Remember to help like and click here after sharing this article !

Guess you like

Origin blog.csdn.net/lyl5454/article/details/112005739
Recommended