I think many companies are interviewing now Java Programmers just stare jvm ask , It's a kind of abandoning the basics . What I can't stand most is that many programmers like to poke a stick to the bottom when solving problems , When you encounter a problem, you think first, don't you JVM of bug, When the delay is high, it will be judged as yes gc There is a problem with the algorithm , Would consider replacing it first gc algorithm , I'm also drunk with this confidence .

So are there really so many projects to tune ?

General projects certainly do not need to be carried out JVM Tuned , because JVM
It is for this low delay , High concurrency , Large throughput service design and optimization , We rarely need to change anything . therefore , We tend to focus more on the tuning of the application service itself .

In some applications , Such as big data computing engine , Is a very extreme JVM
application , The requirement for delay is not high , But it requires high throughput , There will be a large number of short-lived objects , At the same time, a large number of objects live for a long time , We need to be specific JVM Modify parameters .

Another example is memory overflow in the production environment , We need to judge that there is no current limit at large peak , Memory overflow caused by instantaneous creation of a large number of objects , Or is it a memory overflow caused by a memory leak . For memory leaks , This problem is procedural
Bug, We need to find the problem code in time for modification , Not adjustment JVM.

JVM To a great extent Java Developers invest in object lifecycle management . When using objects ,JVM
Memory is automatically allocated to the object , When not in use , The garbage collector automatically recycles objects , Free up occupied memory . Therefore, in general, we do not need to tune . Of course, nothing is absolute , Some special scenarios require us to adjust the parameters , But the premise of adjustment must be that you are right
JVM You should be very familiar with the operation principle of , So the interview asked JVM It's also very normal .

If you have the above performance optimization principles , arrangement , There is no concept of the relationship between generic methods and code quality , I don't know where to start . I've compiled a document here for you to see , Not only include JVM Various frequently asked questions , In addition, there are large factories java Interview questions , I hope it will help you . Not much nonsense ,, Directly above .

 

last

Performance tuning is a protracted battle ! Even after your product goes online , Continuous development is also required , Many factors can cause performance problems , Want to really carry the beam of the company's performance , Don't stick to your company's business , You might as well look at other people's performance optimization ( For example, industry leader Ali ).

Due to too much information, only part of the catalogue is displayed , If you want to take this information to study , You can scan the QR code below for free ( remarks CSDN Receive data ), Full of sincerity, no routine

Technology