Skip to content
Sharp

JVM Architecture interview questions

Class Loading, Metaspace

28 questions with answers and explanations · 28 flashcards

Questions

  1. Why is lazy loading of classes beneficial in a Java application?Multiple choiceMedium
  2. Which tool can be used to analyze Metaspace memory usage in a running JVM?Multiple choiceEasy
  3. How would you explain the key difference between PermGen and Metaspace in an interview?Multiple choiceMedium
  4. Which JVM diagnostic tool provides thread dump information?Multiple choiceMedium
  5. In the context of JVM Garbage Collection, what role does Metaspace play?Multiple choiceHard
  6. Which garbage collection event can impact Metaspace by reclaiming class metadata?Multiple choiceMedium
  7. When a Java class is loaded by the JVM, where is its bytecode initially stored?Multiple choiceEasy
  8. Which diagnostic tool would you use to analyze thread activity during a JVM hang?Multiple choiceHard
  9. What is stored in the Metaspace of the JVM?Multiple choiceEasy
  10. During high traffic, like Black Friday, which JVM GC strategy can help manage memory effectively by minimizing long stop-the-world pauses?Multiple choiceHard
  11. Why does Metaspace over the old PermGen help in practice?Multiple choiceEasy
  12. What potential problem might arise from heavy use of dynamic proxies in a Java application?Multiple choiceMedium
  13. How does Metaspace handle class unloading?Multiple choiceEasy
  14. Why was PermGen replaced by Metaspace in Java 8?Multiple choiceMedium
  15. What impact does excessive use of reflection and dynamic proxies have on Metaspace?Multiple choiceMedium
  16. Which of the following scenarios can lead to a Metaspace OutOfMemoryError?Multiple choiceHard
  17. What happens when a static initialization block is present in a Java class?Multiple choiceMedium
  18. Why does Just-In-Time (JIT) compilation help in practice?Multiple choiceMedium
  19. How does JVM's Metaspace handle memory allocation differently from PermGen?Multiple choiceMedium
  20. When tuning Metaspace, which JVM option allows setting the initial size?Multiple choiceHard
  21. How does the JVM decide when to increase the Metaspace size?Multiple choiceMedium
  22. When analyzing a heap dump after a crash, where would you look for evidence of excessive Metaspace usage?Multiple choiceHard
  23. Which of the following statements about JVM bytecode verification is true?Multiple choiceMedium
  24. In which situation might increasing the Metaspace size not solve an OutOfMemoryError?Multiple choiceHard
  25. Which process describes loading a class only when it is first needed?Multiple choiceEasy
  26. During a stop-the-world pause in garbage collection, what happens to the application threads?Multiple choiceHard
  27. Which JVM diagnostic tool can be used to obtain a thread dump?Multiple choiceMedium
  28. Why does Metaspace in the JVM matter in practice?Multiple choiceEasy