当前位置:网站首页>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());
}
}
}边栏推荐
- [JS reverse hundred examples] Dangle login interface parameters reverse
- How to do domain name resolution? What does domain name resolution mean?
- To create a high-quality geek for human beings, cloud + community starts the competition "discovery plan"
- What is the meaning of Xin domain name? What is the performance in network applications
- How to renew the domain name when it expires
- What is a domain name address? What is the reason for using a domain name address?
- How to buy a website domain name? How to select a website domain name?
- What is the domain name of the website? What problems should be paid attention to when applying for a domain name
- How to register a domain name how to make the domain name short and easy to remember
- [latest offer] 2-core 4G server is limited to 188 yuan, and it is in the process of being snapped up
猜你喜欢
Easy to understand JDBC tutorial - absolutely suitable for zero Foundation
Learning routes and materials for cloud native O & M engineers
What cloud native knowledge should programmers master?

How should we learn cloud native in 2022?

Answer questions! This article explains the automated testing framework in software testing from beginning to end
随机推荐
How about the online domain name? Is it easy to use from the current market
Explain thoroughly and learn rotten binary tree (4): storage structure of binary tree - build heap - Search - sort
What domain name is gov? What should I pay attention to when applying for a domain name?
What are the advantages of building a private cloud platform?
Wang Wei, senior architect of coding Devops, was selected as the first batch of tutors in Mulan open source community
[dry goods] flexible force control grinding tools promote the "smart" transformation of automatic grinding production!
How to build a website with a domain name? Can I build a website before applying for a domain name?
What is a company domain name? What should I pay attention to when registering a company domain name?
How to register a Chinese domain name? Is it necessary to register a Chinese domain name?
The personal information protection law was passed today. What problems should enterprises pay attention to?
What is the third level domain name? How to choose a domain name agent
[competition experience sharing] a problem-solving summary of the whole DFS (internal track)
Adobe international certification wants to design! Understanding the style guide is your best introduction design
What does it mean that the domain name is being walled? How to solve the problem of domain name by wall?
Talk about team management: how to build your own management system!
What are the stages from tradition to Tencent cloud
Spirit breath development log (8)
How should we learn cloud native in 2022?
Analysis and summary of the packet capturing artifact tcpdump - covering major use scenarios and advanced usage
What is the function of DNS domain name server? What is called top-level domain name