Skip to content
Sharp

Performance Tuning · interview question

Which command can you use to generate a Heap Dump in a running Java application?

Multiple choiceMediumchapter-14-curatedpremiumperformance-tuningoutofmemoryerrors
Choose one answer
Answer and explanation

Correct answer

C. Jmap -dump:live,format=b,file=heapdump.hprof <pid>

Why

The jmap command with the -dump option generates a Heap Dump of a running Java application. This dump can be analyzed to understand memory usage and diagnose memory leaks.

Test yourself on Performance Tuning

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

Start free test
All Performance Tuning questions →