JVM Architecture — Concept Check
Questions on JVM Architecture. The JVM comprises a class loader, runtime data areas, execution engine, and native interface — understanding these is key for performance tuning.
Questions in this quiz
8 questions on JVM Architecture — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A Java application is experiencing frequent garbage collection pauses. Which JVM component should you investigate to diagnose the issue?
- AClass Loader Subsystem
- BPC Register
- CNative Method Stack
- DHeap
2.You notice that a Java program is using excessive memory and eventually crashes with an OutOfMemoryError: Metaspace. What is the most likely cause?
- ANative method stack overflow
- BToo many classes generated at runtime
- CRecursive method causing stack overflow
- DHeap space filled with objects
3.A developer claims that enabling the C2 compiler will always improve performance. Why might this be incorrect?
- AC2 disables garbage collection
- BC2 is slower to compile than C1
- CC2 is only for debugging
- DC2 only works with native methods
4.A service is experiencing slow startup times. Which JVM component is least likely to be the cause?
- AHeap
- BClass Loader Subsystem
- CJIT Compiler
- DPC Register
5.During a code review, you see a method without a base case in a recursive call. What error might this cause?
- AStackOverflowError
- BOutOfMemoryError: Metaspace
- CClassNotFoundException
- DNullPointerException
6.A developer uses Class.forName() to load a class but it fails. What might be the issue?
- ANative Method Stack is overloaded
- BPC Register is corrupted
- CClass not found in classpath
- DHeap memory is full
7.A Java application is running slowly, and diagnostics show frequent JIT compilations. What might be a solution?
- AIncrease CompileThreshold
- BDisable TieredCompilation
- CReduce heap size
- DUse interpreter-only mode
8.What happens when a class is first used in a Java program?
- AIt is loaded, linked, and initialized
- BIt is compiled to native code
- CIt is only loaded into memory
- DIt is added to the PC Register