Skip to content
Sharp

Memory Management · interview question

Which JVM flag would you use to analyze memory allocation and garbage collection behavior?

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

Correct answer

D. -XX:+PrintGCDetails

Why

The -XX:+PrintGCDetails flag is used to provide detailed logging of memory allocation and garbage collection activities. This information can help in diagnosing performance issues related to memory management.

Test yourself on Memory Management

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

Start free test
All Memory Management questions →