So you've been tasked with debugging a test instability, and when you look at the CI logs you find a 12345.core file in there. These Core files are memory snapshots of the JVM at the time it crashed, and they can tell us a few useful things:

Preparation

Figure out from the CI logs what image was used for the particular CI run, and download exactly that.

Figure out from the CI logs which JDK was used. This guide focuses on JDK 8; anything listed here may or may not work with Java 11.

Create a new container with the image (and make the core file accessible however you see fit), and install the JDK debug symbols (match with the required JDK).

apt-get install openjdk-8-dbg

Heap dump

/usr/lib/jvm/java-8-openjdk-amd64/bin/jmap -dump:format=b,file=dump.hprof /usr/lib/jvm/java-8-openjdk-amd64/bin/java <core>

Thread dump

jstack -J-d64 /usr/lib/jvm/java-8-openjdk-amd64/bin/java <core>

System properties / JVM flags

/usr/lib/jvm/java-8-openjdk-amd64/bin/jinfo /usr/lib/jvm/java-8-openjdk-amd64/bin/java core.21155
  • No labels