Dry goods sharing JVM Part 2 - thread pool
To view the previous blogs, click [category column] at the top
What is a thread pool?
Thread pool in Java is the concurrency framework with the most application scenarios. Almost all programs that need to execute tasks asynchronously or concurrently can use thread pool. In the development process, the rational use of thread pool can brin ...
Posted by WiseGuy on Sat, 29 Jan 2022 05:58:42 +0100
java memory mechanism of JVM
Java memory structure
1. Program Counter Register
Function: remember the execution address of the next jvm instruction For example, when executing instruction 0, the program counter will remember 3. When the execution of 0 is completed, the interpreter will take the instruction of 3 from the program counter, and so on. The instruction is i ...
Posted by jmcall10 on Fri, 28 Jan 2022 19:32:20 +0100
Java Cglib dynamic agent principle source code analysis
Environment: Java 8
Cglib agent usage
System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "E://cglib");
Enhancer enhancer = new Enhancer() ;
enhancer.setSuperclass(PersonDAOImpl.class) ;
enhancer.setCallback(new MethodInterceptor() {
@Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy pr ...
Posted by Chesso on Fri, 28 Jan 2022 05:51:53 +0100
In depth analysis of Java enumeration classes at bytecode level
Use of enumeration classes
Define a simple enumeration class, which contains several enumeration constants. Examples are as follows:
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY, FRIDAY, SATURDAY
}
Java's switch statement parameters support the use of enumeration classes
// Day is a variable of type day
switch (day) {
...
Posted by MBDesktop on Thu, 27 Jan 2022 16:01:47 +0100
Virtual machine class loading mechanism - class loading process
The Java virtual machine loads the data describing the Class from the Class file into the memory, verifies, converts, parses and initializes the data, and finally forms a Java type that can be directly used by the virtual machine. This process is called the Class loading mechanism of the virtual machine.
Class loading timing
A type starts fro ...
Posted by tblade on Thu, 27 Jan 2022 08:24:16 +0100
Rumor shredder: using try catch in JAVA will seriously affect the performance
preface:
I don't know when it came out that using try catch in Java will seriously affect performance.
However, is this really the case? Should we be afraid of try catch like tigers?
1, JVM exception handling logic
Explicit exception throwing in Java programs is supported by the arrow instruction. In addition to actively throwing exception ...
Posted by pasychosheep on Tue, 25 Jan 2022 02:09:37 +0100
Chapter 13 - StringTable
Chapter 13 - StringTable
1. Basic characteristics of string
String: string, represented by a pair of "" String s1 = "baidu"; //Definition of literal quantity
String s2 = new String("hello");
String is declared as final and cannot be inherited String implements the Serializable interface: it means that the string supports ser ...
Posted by bubblegum.anarchy on Mon, 24 Jan 2022 15:28:29 +0100
In depth Java class loading mechanism
Initial class loading process
When using a class, if the class file of the class is not loaded into memory, the system will initialize the class through the following three steps
1. Class loading → 2 Class connection (Link) → 3 Class initialization
Class Load: read the class file of the class into memory and create a Java. Net file ...
Posted by jibster on Sat, 22 Jan 2022 16:59:55 +0100
[explain Java interview questions with pictures and text] - String, StringBuilder, StringBuffer, Exception, Error
Differences among String, StringBuilder and StringBuffer
Know what it is and why. We want to answer the basic characteristics of String.
String
String is Java A class under Lang packageModified by the final keyword and cannot be inheritedThe internal data structure of JDK8 is char[] value modified by final, and JDK9 is Byte[] value array ...
Posted by jemgames on Tue, 18 Jan 2022 09:46:56 +0100
Detailed explanation of virtual machine class loading mechanism
Detailed explanation of virtual machine class loading mechanism
1 Overview
The Java virtual machine loads the data describing the Class from the Class file into memory, verifies, converts, parses and initializes the data, and finally forms a Java type that can be directly used by the virtual machine. This process is called the Class loading m ...
Posted by adguru on Mon, 17 Jan 2022 13:10:25 +0100