Nobody Puts Java in a Container
summary
Containers expose kernel features not full VMs, so Java defaults can be wrong: JDK7/8 reads host CPU count, so a 4‑CPU container on a 32‑core host still initializes for 32 cores; JDK9 uses CPU affinity/cpuset. Memory is worse: metaspace and native off‑heap aren’t limited by heap flags, and hitting a cgroup memory limit causes the process to be OOM‑killed rather than throwing Java OOME. Practical fixes shown: set explicit JVM flags (heap, GC threads), use cpusets not just cpu‑shares, or generate container startup scripts; full JVM container APIs are still pending.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:38Dirty Dancing
- 1:00Java in Containers
- 1:27About Jrg
- 2:56Containers
- 4:09Container vs VM
- 7:02Docker Container
- 7:43Containers vs VMs
- 9:52Container Isolation
- 10:12Isolation guarantees
- 11:07Namespaces and Control Groups
- 12:53Control Groups
- 14:03Process Groups
- 14:46Memory Limits
- 15:44CPUC Groups
- 16:09CPU Priority
- 17:31CPU Sets
- 18:15namespaces
- 19:43Java
- 20:30Java Memory
- 23:27Containers and Java
- 25:45Memory
- 27:17Conclusion
- 29:50Limitations for different programming languages
- 31:21Practical approaches
