JVM source code analysis: processing details of soft, weak and virtual references

Table of Contents Write in front: Source code analysis: Java level: JVM level: Danger points of use: Summarize: Version Information: jdk version: jdk8u40 Garbage collector: Serial new/old Write in front: Different garbage collectors have different algorithms and different efficiencies. The default is ParallelScavenge new/old in JDK8. The author used Serial new/old when writing the article. […]

7.2Loading timing of jvm class

Class loading timing–based on jdk1.8 1. Under what circumstances will a class be loaded? 1. Encounter the following 4 bytecode instructions 2. Use reflection to make a reflective call to a certain type 3. When initializing a class, if it is found that its parent class has not been initialized, you need to trigger the […]

Remember the jvm tuning process in detail

Cpu usage is too high If the CPU usage is too high, we need to discuss it on a case-by-case basis. Is it because there is a business activity, and suddenly a large amount of traffic comes in, and the CPU usage drops after the activity is over. If this is the case, you don’t […]

Java Virtual Machine (JVM)

JVM Introduction to JVM Overall structure of JVM JVM runtime data area program counter Java virtual machine stack native method stack heap method area Class loading mechanism 1. Loading 2. Verification 3. Preparation 4. Resolution 5. Initialization class loader Bootstrap ClassLoader Extension ClassLoader: Application ClassLoader: Parent delegation mechanism Introduction to JVM JVM (Java Virtual Machine) […]

Multi-level cache JVM process cache

1. What is multi-level cache The traditional caching strategy is generally to query Redis after the request reaches Tomcat. If there is no hit, query the database, as shown in the figure: The following problems exist: The request needs to be processed by Tomcat, and the performance of Tomcat becomes the bottleneck of the entire […]

JVM performance optimization – class loader, manually implement hot loading of classes

1. Hierarchy of class loading mechanism Each written class file with the “.java” extension stores the program logic that needs to be executed. These “.java” files are compiled into files with the extension “.class” by the Java compiler. The “.class” files are saved in According to the virtual machine instructions after the Java code is […]

[jvm] Dynamic link of virtual machine stack

Directory 1. Description 2. Code examples 3. Generated bytecode 4. Bytecode description 4.1 Constant pool 4.1 Method call 4.3 Variables 4.4 String 4.5 Parent class Object 4.6 System class 1. Description 1. Method reference pointing to the runtime constant pool 2. Each stack frame contains a reference to the method to which the stack frame […]