Skip to content
Sharp

Performance Tuning · interview question

How would you use 'jstack' to diagnose an infinite loop in a Java application?

Multiple choiceMediumchapter-14-curatedpremiumperformance-tuningthread-dumps
Choose one answer
Answer and explanation

Correct answer

A. Identify threads with recurring stack traces

Why

In an infinite loop, a thread's stack trace will show the same method repeatedly, indicating it is stuck in a loop. By analyzing recurring stack traces with jstack, you can identify such issues.

Test yourself on Performance Tuning

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

Start free test
All Performance Tuning questions →