Memory Management · interview question
A service that creates many runtime proxies crashes with OutOfMemoryError: Metaspace. What is the most likely problem?
Multiple choiceMediumchapter-14-curatedpremiummemory-managementmetaspace
Answer and explanation
Correct answer
B. Class metadata growth or a ClassLoader leak, not ordinary business objects on the heap
Why
Metaspace issues commonly come from excessive class generation or ClassLoaders that never become eligible for cleanup. They are different from heap leaks caused by retained domain objects.
Test yourself on Memory Management
A free test with instant, explained results. No account needed.
More Memory Management questions
- Which JVM flag would you use to analyze memory allocation and garbage collection behavior?
- Why does a reference variable in Java memory management matter in this design?
- Why do teams use the 'jstack' tool in Java in production code?
- In a multi-threaded Java application, where do the different threads store their method call frames?
- Why does the Z Garbage Collector (ZGC) over traditional collectors help in practice?
- How does the G1 Garbage Collector differ from traditional collectors in Java?