Skip to content
Sharp

Memory Management · interview question

Which section of memory is used to store static variables and loaded classes in the JVM?

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

Correct answer

B. Metaspace

Why

Metaspace is responsible for storing class metadata, static variables, and other JVM runtime information. It replaced the older PermGen space to allow for dynamic resizing and better management of class metadata.

Test yourself on Memory Management

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

Start free test
All Memory Management questions →