Java Resources
Various Java resources.
General
- Java Snippets - garbage collection tuning and other snippets.
- Fasterj
- Big-O summary for Java Collections Framework implementations?
- Introduction to Rx
- RxJS Operator Decision Tree
Libraries
- Dagger - dependency injection.
- Guava
- Jackson - JSON and other data serialisation.
- Jdbi - SQL library.
- jOOQ - SQL library.
- Mockito - Mocking library.
- Netty HTTP - JAX-RS wrapper for Netty.
- Netty - network library.
- picocli - CLI handling.
- Reed-Solomon
Java 17
Java 8
Reactive Programming
Jackson
- Reading CSV with Jackson - cowtowncoder
- Writing CSV with Jackson - cowtowncoder
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.