Skip to content
Sharp

Performance Tuning interview questions

Garbage Collection Basics, OutOfMemoryErrors, Stop-The-World Pauses, Thread Dumps

67 questions with answers and explanations · 67 flashcards

Questions (page 1 of 2)

  1. Why does a memory leak on JVM performance change runtime behavior?Multiple choiceMedium
  2. In a system using the Z Garbage Collector (ZGC), what is a notable advantage compared to traditional Stop-The-World garbage collectors?Multiple choiceHard
  3. How would you explain a common cause of a 'java.lang.OutOfMemoryError: Metaspace' error in a JVM application in an interview?Multiple choiceEasy
  4. How would you explain a key advantage of the Z Garbage Collector (ZGC) over traditional garbage collectors in an interview?Multiple choiceMedium
  5. CPU is pinned and requests are hanging. Which artifact tells you what threads are doing right now?Multiple choiceMedium
  6. What does the Z Garbage Collector (ZGC) mainly aim to achieve?Multiple choiceMedium
  7. In the context of JVM garbage collection, what is the main benefit of using the G1 Garbage Collector over traditional collectors like CMS?Multiple choiceMedium
  8. Why do teams use a thread dump (jstack) when diagnosing application performance issues in production code?Multiple choiceEasy
  9. How would you explain a key benefit of using the Z Garbage Collector (ZGC) in high-performance applications in an interview?Multiple choiceHard
  10. In the context of generational garbage collection, what is the primary role of the 'Old' generation?Multiple choiceMedium
  11. Why does a 'Thread Dump' in diagnosing JVM issues matter in this design?Multiple choiceMedium
  12. How does ZGC achieve concurrent memory relocation without significant pauses?Multiple choiceHard
  13. In what way does G1GC attempt to predict and control pause times?Multiple choiceHard
  14. When analyzing a thread dump, what type of information would you expect to find?Multiple choiceMedium
  15. Which aspect of G1GC makes it suitable for applications requiring predictable pause times?Multiple choiceMedium
  16. Why might an application experience increased latency when using the Generational Garbage Collection model?Multiple choiceMedium
  17. Which garbage collector is designed to minimize pause times and is suitable for applications requiring low latency?Multiple choiceMedium
  18. Which tool would you use to analyze memory leaks by inspecting heap dumps?Multiple choiceMedium
  19. What does the 'RUNNABLE' state indicate in a Java thread dump?Multiple choiceEasy
  20. Which of the following describes a major advantage of using ZGC over G1GC?Multiple choiceHard
  21. Why does a Thread Dump in Java matter in practice?Multiple choiceEasy
  22. What does the java.lang.OutOfMemoryError: Java heap space indicate?Multiple choiceEasy
  23. Why is it risky to diagnose production latency from GC logs alone?Multiple choiceHard
  24. Which of the following scenarios is most likely to trigger a 'Stop-The-World' pause in a JVM?Multiple choiceHard
  25. What can cause a java.lang.OutOfMemoryError: Java heap space?Multiple choiceEasy
  26. Why does the difference between the Young and Old Generation in the Generational Garbage Collection model matter in practice?Multiple choiceMedium
  27. In the context of garbage collection, what is a 'young generation'?Multiple choiceMedium
  28. Which tool would you use to analyze Java heap memory allocation and identify objects consuming the most memory?Multiple choiceMedium
  29. How does a Stop-The-World (STW) pause affect a running Java application?Multiple choiceMedium
  30. How would you explain a key difference between the G1GC and the ZGC in terms of handling large heaps in an interview?Multiple choiceHard
  31. Which of the following scenarios might lead to a 'stop-the-world' pause, even when using a collector like ZGC?Multiple choiceHard
  32. When might you prefer using G1GC over ZGC in a Java application?Multiple choiceHard
  33. Which feature of the G1 Garbage Collector helps to minimize pause times compared to traditional collectors?Multiple choiceHard
  34. How does G1GC differ from traditional garbage collectors in its approach to managing heap memory?Multiple choiceMedium
  35. How does the G1 Garbage Collector prioritize regions for collection?Multiple choiceHard
  36. How does the 'jstack' tool help in diagnosing a deadlock situation?Multiple choiceMedium
  37. When analyzing a thread dump, you notice several threads are in a BLOCKED state waiting on a monitor. What might this indicate?Multiple choiceMedium
  38. Two services show similar steady-state heap size, but one has much worse throughput. Which explanation fits best?Multiple choiceHard
  39. What can a thread dump reveal if 500 threads are blocked on HikariPool database connections?Multiple choiceMedium
  40. In the context of JVM Garbage Collection, what is a 'Stop-The-World' pause?Multiple choiceMedium
  41. Why do teams use a heap dump when diagnosing application memory issues in production code?Multiple choiceEasy
  42. Why might you observe a 'runnable' thread in a thread dump that does not seem to be progressing?Multiple choiceMedium
  43. What does it usually mean if many request threads are parked in HikariPool.getConnection()?Multiple choiceEasy
  44. How would you use 'jstack' to diagnose an infinite loop in a Java application?Multiple choiceMedium
  45. Which diagnostic tool is used to capture a snapshot of all JVM threads?Multiple choiceEasy
  46. What role does Metaspace play in Java's memory model?Multiple choiceHard
  47. Which garbage collection algorithm is designed to handle large heaps with minimal pause times?Multiple choiceEasy
  48. How can static references cause memory leaks in Java?Multiple choiceHard
  49. Which garbage collector attempts to achieve predictable pause times by dividing the heap into regions and collecting them incrementally?Multiple choiceMedium
  50. Why do teams use ZGC over G1GC in applications with large heaps in production code?Multiple choiceHard