Containers & Java: What I wish I have been told!
summary
Shows concrete failure modes and fixes: JVMs prior to Java 10–11 ignore cgroup limits so JVM assumes full host memory and picks a 1/4-heap (demo: 8GB VM → 2GB heap) causing OOM/kills when container memory limits are applied and swap is disabled. Offers practical fixes: Java 10/11 container-awareness options and jlink modular JDKs, CDS/AOT and GraalVM native-image under 10MB for tiny fast images. Tooling: multistage Docker, BuildKit, Jib for daemonless builds, Testcontainers and image scanning; examples show what reduced size and startup gains actually look like.
AI-written summary · about
chapters (14)
- 0:00Introduction to Java containers
- 1:52How containers work
- 4:53Java in containers
- 5:55Creating effective Java images
- 11:53Base image options
- 14:10Optimizing startup time
- 21:55Tools for Java developers
- 24:31Advanced build techniques
- 26:38Container versioning
- 27:45Container security
- 30:32Testing with containers
- 31:07Memory management demo
- 33:54Understanding JVM ergonomics
- 36:36Java container awareness
related talks
48mJava in Containers - Part Deux
49mJava and Containers Make it Awesome
58mContainer Friendly Java 9
50mWhy you’re going to FAIL running Java on docker!
07mBest Practices with JVMs in Containers
47mLegal JVM Doping in Your Containers
46mJava in Container - Best Practicies for containerized Java Apps
50mJVM and Kubernetes walk into the bar...
