Skip to content
Sharp

Memory Management · interview question

What role does Metaspace play in Java's memory management?

Multiple choiceMediumchapter-14-curatedpremiummemory-managementstack-vs-heap
Choose one answer
Answer and explanation

Correct answer

A. Stores class metadata and static methods.

Why

Metaspace in Java stores class metadata and static methods, among other things. Unlike the earlier PermGen space, Metaspace is allocated in native memory, which helps avoid some memory limitations and leaks associated with class loading.

Test yourself on Memory Management

A free test with instant, explained results. No account needed.

Start free test
All Memory Management questions →