JVMs knowledge you need to know in Java interviews

2023/04/02 1:21

  1. What is a JVM? What does it do?
  2. What are the root nodes in the reachability analysis algorithm?
  3. What is GC? Why should there be GC? How do I tune GC?
  4. How to troubleshoot high CPU and memory?
  5. Escape Analysis
  6. Where is the static internal class loaded? Method area
  7. Describe the principle and mechanism of JVM loading class files?
  8. Java memory model, garbage collection mechanism, unreachable algorithm
  9. How is the jvm garbage collection mechanism implemented, the collection algorithm, when objects will be collected, what is gc-root, which objects can be used as gc-root, what situations can be caused by tag counting, and what algorithms are commonly used for garbage collection mechanisms now
  10. jvm memory model, java memory model
  11. How much do you know about JVM memory models, such as reordering, memory barriers, happen-before, main memory,
  12. Working memory, etc.
  13. What are the main components of a JVM?
  14. The area allocation of the Java virtual machine, and what are stored in each area
  15. If an object’s reference is set to null, will the garbage collector immediately release the memory occupied by the object?
  16. Briefly describe Java memory allocation and recovery policies, as well as Minor GC and Major GC.
  17. Will garbage collection occur in the permanent generation of the JVM?
  18. What are class loaders and what are they?
  19. Class Loader Parental Delegation Model Mechanism?
  20. Where is the class file loaded after compilation
  21. How to dump all data in Java memory
  22. How to manually trigger full garbage collection, and how to immediately trigger garbage collection
  23. How does the JVM work?
  24. What is the difference between heap and stack?
  25. What is the basic principle of a garbage collector? Can the garbage collector immediately reclaim memory? Is there any way to proactively notify a virtual machine for garbage collection?
  26. What reference types are available in Java?
  27. How can I determine whether an object can be recycled? (Determining whether an object exists) How to determine whether an object exists
  28. What garbage collection algorithms does the JVM have? (4 types)
  29. What garbage collectors does the JVM have? The advantages and disadvantages of each of the (7) types, focusing on cms and G1, including principles, processes, advantages and disadvantages. Throughput first and response first garbage collector selection
  30. Implementation principle of garbage collection algorithm.
  31. Briefly describe how generational garbage collectors work?
  32. In the Java language, determining whether a piece of memory space meets the standards for garbage collector collection
  33. Tell me about three GC mechanisms. When will the younger generation trigger GC? When is young gc, full gc?
  34. Class loading mechanism
  35. Write out ⼏ jvm optimization configuration parameters. JVM Common Parameters (Please take out a piece of paper and write it silently)
  36. Memory structure of the JVM, Eden and Survival ratios.
  37. Why should JVM memory be divided into new generation, old generation, and persistent generation. Why should the Cenozoic be divided into Eden and Survivor.
  38. What do System. gc() and Runtime. gc() do?
  39. What is a complete GC process in a JVM? How can objects be promoted to the old age? Describe some of the main JVM parameters you know. Briefly describe the process of sub GC (remember the Minor GC and Major GC processes)
  40. Briefly describe the class loader you know, can it break parental delegation, and how to break it.
  41. How to print the thread stack information.
  42. Do the getClass() results of two ArrayList objects get the same (understand class loading and class type)
  43. What is Distributed Garbage Collection (DGC) and how it works
  44. What is the difference between a serial collector and a throughput collector?
  45. Class loading and parental delegation mechanism. If you know that tomcat breaks parental delegation, you will receive additional points.
  46. Chang’s OOM, Four Quotes, and Classic Cases (localthread)
  47. How is a Java object created?
  48. What are the methods for creating objects?
  49. Where to store String str1=”hello” str1, where to store hello, and the memory model of the jvm. String str1 = “hello” ; String str2 = “hello” ; The creation process of str2
  50. sting s=new string (“abc”) Which objects have been created on the stack
  51. String s=new String(“xyz”); How many string objects have been created?
  52. The detailed process of the underlying implementation of sync, lock optimization, and the tuning of jvm parameters such as lock, including why this is set, benefits, some gc scenarios, and how to analyze gc logs
  53. Junit usage, execution order of before, beforeClass, after, afterClass
  54. What are the common causes of stack overflows?
  55. When does stack memory overflow occur.
  56. What is the difference between a memory leak and a memory overflow? Let’s talk about what is a memory leak and a memory leak, what conditions can lead to memory leaks and overflows, and how do you troubleshoot memory leaks when they occur.
  57. What is a deadlock, the reasons for it, the basic methods to resolve it, how to avoid it, and how to check it.

Leave a Reply

Back to top