JVM basics section 1
#JVM basics section 1
JVM introduction
java Non running on virtual machine platform Java Language program
java source code->Binary bytecode(.class (file) ->JVM-> interpreter->Machine code->CPU
It only cares about "bytecode" files
Java Not the most powerful language, but JVM Is the most powerful virtual machine
...
Added by nivek9991 on Sun, 28 Nov 2021 15:39:22 +0200
[JVM source code analysis] the template interpreter interprets and executes Java bytecode instructions
This article is compiled and published by jiumo (Ma Zhi), chief lecturer of HeapDump performance communityPart 22 - virtual machine bytecode operation instructionsThe operation related bytecode instructions in the virtual machine specification are shown in the following table. 0x60iaddAdd two int values at the top of the stack and press the r ...
Added by deveed on Thu, 25 Nov 2021 06:12:23 +0200
equals and = = Application and difference (in-depth understanding of source code)
equals and = = Application and difference (in-depth understanding of source code)
Double equal sign (= =)
Two cases of double equal sign comparison
For the = = sign, only two cases need to be considered:
The basic data type uses = =, comparing valuesThe reference data type is = =, which compares the (heap) memory address of the object s ...
Added by rReLmy on Tue, 23 Nov 2021 23:21:24 +0200
Btrace java online troubleshooting artifact
What is BTrace
BTrace is a killer for checking and solving online problems. BTrace can obtain all information during program execution by writing scripts. Note that there is no need to restart the service. Yes, there is no need to restart the service. Write a script and execute it directly with commands without touching the code of the origina ...
Added by dagon on Thu, 04 Nov 2021 18:48:23 +0200
Cow batch! Finally, someone explained the JVM memory allocation mechanism clearly! Super detailed analysis!
1, Object loading process
So, how is an image loaded when it is new? What are the steps and how to allocate memory space?
1.1 main process of object creation
Take this code as an example:
public static void main(String[] args) {
Math math = new Math();
math.compute();
new Thread().start();
}
When we create a New Math object, ...
Added by Bounty on Mon, 18 Oct 2021 20:32:33 +0300
JVM_8_ Memory model
Atomicity
Many people confuse [java memory structure] with [Java Memory Model]. Java Memory Model means Java Memory Model (JMM).
For its authoritative explanation, please refer to https://download.oracle.com/otn-pub/jcp/memory_model-1.0-pfd-spec-oth-JSpec/memory_model-1_0-pfd-spec.pdf?AuthParam=1562811549_4d4994cbd5b59d964cd2907ea22ca08b ...
Added by kef on Thu, 30 Sep 2021 23:39:17 +0300
Static and Dynamic Assignments
The three main features of JAVA are inheritance, encapsulation, and polymorphism. The dispatch call process will reveal some of the most basic manifestations of polymorphism, such as override and overload.
1. Static Assignment
Before introducing static assignment, let's look at a piece of code
public class StaticDispatch {
static abstrac ...
Added by Skittlewidth on Mon, 27 Sep 2021 20:25:19 +0300
Understanding JVM Bottom Principle-Heap
Content Review:
1. Core overview of Heap
Description of 1.1 heap memory
There is only one heap memory for a JVM instance, and the heap is also the core area of Java memory management.The Java heap area is created when the JVM starts and its size is determined. It is the largest piece of memory space managed by the JVM.
The size of hea ...
Added by john1704 on Tue, 14 Sep 2021 19:58:59 +0300
[principle of Java virtual machine] garbage collection algorithm (reachability analysis algorithm | CG Root example | twice marking before CG COLLECTION | finalize method example)
1, Reachability analysis algorithm
In heap memory, there is a root object GC root, and CG root objects are generally the following:
The reference object in the local variable table in the stack frame in the thread stack;Static reference objects in the method area;Constant reference objects in the method area;The referenced obj ...
Added by leena on Sat, 04 Sep 2021 08:34:46 +0300
References in Java and JNI (strong, soft, weak, virtual)
1. Strong References (Objects)
Features:
Strong references provide direct access to the target object.
Will not be recycled.
Two, soft reference (SoftReference class)
Features:
When GC reclaims based on JVM memory, JVM reclaims when it finds it is out of memory
Conditions for freeing up space: JVM found insufficient m ...
Added by trygve on Sun, 19 Jul 2020 18:32:41 +0300