Java Resources

Written on . Last updated on .

Various Java resources.

General

Libraries

Java 17

Java 8

Reactive Programming

Jackson

Thread Dumps

Basic thread dump:

jstack <pid>

However, this will only print stack traces from platform threads. To get vitual threads as well, use:

jcmd <pid> Thread.dump_to_file -overwrite threads.dump

Then just cat threads.dump to see it.

Flight Recorder

Instruct a running JVM to record for 60 seconds:

jcmd <pid> JFR.start duration=60s filename=flight.jfr

Copy file out of Docker container, if needed:

docker cp <containerId>:flight.jfr .

The file can be analysed with JDK Mission Control.