当前位置:网站首页>What happened to the JVM locking on Tencent ECS?
What happened to the JVM locking on Tencent ECS?
2022-06-24 05:41:00 【User 8639654】
One Why do you say this ?
summary AQS after , By the way, let's review this aspect . This paper starts from the following high frequency problems :
- What is the memory layout of objects in memory ?
- describe synchronized and ReentrantLock The underlying implementation of and the underlying principle of reentry .
- Talk about AQS, Why? AQS The bottom is CAS+volatile?
- Describe the four states of the next lock and the lock upgrade process ?
- Object o = new Object() How many bytes does it take up in memory ?
- Is spin lock necessarily more efficient than heavyweight lock ?
- Whether the efficiency of opening the deflection lock will definitely be improved ?
- What's the weight of a heavyweight lock ?
- When is a heavyweight lock more efficient than a lightweight lock , And vice versa ?
Two What happened to locking ?
The unconscious use of locks :
//System.out.println They're all locked
public void println(String x) {
synchronized (this) {
print(x);
newLine();
}
}
What happens to simple locking ?
To find out what happens after locking, you need to look at the layout in memory after the object is created ?
An object is in new After coming out, it is mainly divided into 4 Parts of :
markword This part is actually the core of locking , It also contains some life information of the object , For example, whether GC、 After several times Young GC Still alive .
klass pointer It records the... That points to the object class The file pointer .
instance data Record the variable data in the object .
padding Use as alignment , The object is 64 Bit server version , Specifies that object memory must be able to be 8 Byte Division , If it's not divisible , Then rely on the right Qi Laibu . for instance :new I have an object , Memory only takes up 18 byte , But the rules have to be able to be 8 to be divisible by , therefore padding=6.
public class JOLDemo {
private static Object o;
public static void main(String[] args) {
o = new Object();
synchronized (o){
System.out.println(ClassLayout.parseInstance(o).toPrintable());
}
}
}边栏推荐
- [experience sharing] 1.39 million problem solving report of Tencent's internal track
- How to buy a website domain name? How to choose a website domain name?
- Spirit breath development log (8)
- Net domain name how to choose a domain name
- How to check the Chinese domain name of the website and through what channels?
- When we talk about zero trust, what are we talking about?
- [JS reverse hundred examples] Dangle login interface parameters reverse
- Netaapp data recovery process
- Enterprise image warehouse
- What enlightenment does it consulting giant Accenture get from the blackmail attack?
猜你喜欢

How should we learn cloud native in 2022?
Learning routes and materials for cloud native O & M engineers
Easy to understand JDBC tutorial - absolutely suitable for zero Foundation

Answer questions! This article explains the automated testing framework in software testing from beginning to end
What cloud native knowledge should programmers master?
随机推荐
Tamp the foundation, step into the cloud and rise to the original cloud Devops
How to register an enterprise domain name? Can an enterprise domain name be directly registered by individuals?
What is the meaning of Xin domain name? What is the performance in network applications
What are the advantages of building a private cloud platform?
[the lottery in June has ended, and the list of winners has been announced] special cloud development session of techo Youth College Open Class
How should we learn cloud native in 2022?
How to get a secondary domain name? What does a secondary domain name mean?
Net domain name how to log in to a website
When a beef cow has an "electronic ID card"
What domain name is cheap? How much does it cost to register a domain name?
Learning routes and materials for cloud native O & M engineers
Live video: real time large screen analysis based on streaming computing Oceanus (Flink)
PXE introduction and use
Error 0xc0000013, 0xc000007b, etc. due to the conflict between the CD-ROM drive letter and the drive letter in the business program path
Oceanus practice - use of the Nepal graph connector in the graph database
[performance test] 3 How to calculate the number of concurrent users
Threat discovery under automated data analysis
What is a company domain name? What should I pay attention to when registering a company domain name?
Pylin tool usage
Explain thoroughly and learn rotten binary tree (4): storage structure of binary tree - build heap - Search - sort