Thread dumps, memory dump, and stack traces

1. Getting a Stack Trace

jstack -l [pid]

jstack is for java processes

2. Getting a Thread Dump

kill -3 [pid]

on unix

3. Surviving a OutOfMemoryException in Production

Sometimes you see an “OutOfMemoryException” in production and you need a memory dump of this process now to analyze the memory usage

jmap -J-d64 -dump:live,format=b,file=solr-memory-dump.bin [pid]
jmap generates a memory dump file solr-memory-dump.bin that can be used for further analysis

jhat -J-d64 -J-Xmx4096m solr-memory-dump.bin
jhat opens HTTP server on port ‘7000’

Advertisements
This entry was posted in news and tagged , , , , , , , . Bookmark the permalink.

One Response to Thread dumps, memory dump, and stack traces

  1. gerhardpoul says:

    Kleiner Tipp: Etwas komfortabler um heapdumps zu analysieren sind unser HeapAnalyzer oder der Eclipse Memory Analyzer.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s