Memory Management · interview question
Why do teams use the 'jstack' tool in Java in production code?
Multiple choiceMediumchapter-14-curatedpremiummemory-managementstack-vs-heap
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.
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?
- A service that creates many runtime proxies crashes with OutOfMemoryError: Metaspace. What is the most likely problem?
- 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?