Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bugcy013/3f4ca35efb47b00443e92305663f69d2 to your computer and use it in GitHub Desktop.
Save bugcy013/3f4ca35efb47b00443e92305663f69d2 to your computer and use it in GitHub Desktop.
Heap Dump and thread dump and core dump differences.

Heap dump

  • Collection of objects that are in memory (JVM)
  • is useful to analyse OOM situations.
  • then How to take jmap -dump:format=b,file=cheap.bin <pid>

Thread dump

  • Shows what each thread in a process is doing at a given point in time along with the stack trace.
  • To troubleshoot slow running of your application.
  • then How to take

jstack -l <pid> > <file-path> kill -3 <pid> # sent to the standard error stream or kill -SIGQUIT <PID>

Core dump

  • O/S level dump file which has O/S level info in addition to the heap dump.
  • When your JVM has crashed abruptly. To find details about native calls and so on.
  • then How to take

1. ulimit -c unlimited 2. sysctl -w kernel.core_pattern=/tmp/core-%e.%p.%h.%t

kill -6 <pid> or kill -ABRT <pid>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment