Java inside docker: What you must know to not FAIL | Red Hat Developer
TIL: (but I didn’t want to!) – To configure your Java/JVM based apps to run in a container (Linux cgroup) environment correctly set these JVM options:
-XX:+UnlockExperimentalVMOptions and -XX:+UseCGroupMemoryLimitForHeap
If you don’t, the JVM does stupid shit 😅 #Java #Docker #Linux #Containers
Also if you’re lucky enough to be using JVM 10+ (or unlucky to be forced into writing Java™ code 🤮) this correct behaviour is now just built-in to the newest JVM v10+ and the options are no longer required.
@prologic@twtxt.net Back in the days in an R&D project we ran into something similar (or the same? – didn’t read the article). I don’t remember the details anymore, but each containerized JVM thought, that it could use up the whole hardware cluster system resources and didn’t obey the limits set in the container. And then of course it got killed.