preface

Recently, a fan complained to me in the background that he went to a big factory for an interview, and the interviewer always liked to ask about JVM!

What does the JVM do? Programmers don’t usually use these things! Ask about frameworks, databases, and project experience.

Some people think it is the interviewer ZB, love to ask this kind of false things, it appears that their cattle force, the company cattle force!

In fact, this idea is very naive! I can’t rule out that some interviewers have this idea and like to torture people during interviews. However, big factory has big factory’s consideration, ask JVM mainly depends on your potential in the technical direction, you see whether you have a deep attitude towards technology.

Around 2011, Alipay had several memory leaks, and the problem was quite serious. At that time, Master Bi Xuan led the team to solve the problem. Around 2013, Ali developed rapidly and many architectures were completely based on OSGI. The problems of JVM became more and more prominent. If you did not understand the underlying mechanism of JVM, you could not do anything about it.

There is also a more important reason, is now Java development positions, too damn fierce competition!

Some time ago, our director recruited a Java backend, two days received more than 200 resumes! It’s impossible to sift through so many resumes!

The position of big factory usually only recruit one or two people, there are 10 people who meet the requirements, and their technical ability is almost the same. Who would you choose at this time?

What will the JVM interview ask?

If I were an interviewer, I would ask who does JVM performance tuning? Whoever will, whoever has the better technical ability! BAT is like this, many small companies also like to follow the trend, so the interview does not ask about JVM tuning are embarrassed to say hello to others. So, the JVM is important, and the ability to tune the JVM is even more important.

Take a look at these ali interview questions and can you answer them?

1. What are the memory regions of the JVM? Why is that?

2. What are GC Roots? The more comprehensive the better.

3, a hundred million level flow system, so that it almost does not happen Full GC. You do JVM tuning, how do you do that?

4, the online system suddenly CPU100%, how do you check?

4, JVM memory leak and memory overflow difference, how to check memory leak?

These questions, from shallow to deep, must have a systematic understanding and learning of THE JVM, and basically all the interview questions are combined with the actual situation to ask, not only requires you to know how to use these technologies, but also know why to use this technology, and how to achieve high availability and so on. Mastery of the JVM requires a high degree of skill breadth and depth on the part of the programmer.

JVM core

  • thread
  • JVM memory region
  • JVM runtime memory
  • Garbage collection and algorithms
  • JAVA four reference types
  • GC generation collection algorithm VS partition collection algorithm
  • GC garbage collector
  • JVM class loading mechanism

The latest JVM interview question

  • Java class loading process?
  • Describe how the JVM loads Class files.
  • Java memory allocation
  • What is GC? Why GC?
  • Describe the Java garbage collection mechanism
  • How do you tell if an object is alive? (or GC object determination method)
  • .

  • Advantages and principles of garbage collection. Two recycling mechanisms are considered
  • What is the rationale behind the garbage collector? Can the garbage collector reclaim memory right away? Is there any way to proactively notify the virtual machine for garbage collection?
  • Is there a memory leak in Java? Please describe it briefly
  • Deep copy and shallow copy
  • .

Follow the public account below to get all the interview questions above!