Skip to content
Sharp

Memory Management · interview question

Why do teams use the 'jstack' tool in Java in production code?

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

Correct answer

C. To capture thread states and stack traces.

Why

The 'jstack' tool is used to capture thread states and stack traces, which can be crucial for diagnosing issues like deadlocks or thread contention. It provides a snapshot of what each thread in a JVM is currently doing.

Test yourself on Memory Management

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

Start free test
All Memory Management questions →