Kubernetes Pod OOMKilled Solution Kubernetes Pod OOMKilled Solution kubernetes kubernetes

Kubernetes Pod OOMKilled Solution


More than a Kubernetes/Container runtime issue this is more memory management in your application and this will vary depending on what language runtime or if something like the JVM is running your application.

You generally want to set an upper limit on the memory usage in the application, for example, a maximum heap space in your JVM, then leave a little headroom for garbage collection and overruns.

Another example is the Go runtime and looks like they have talked about memory management but with no solution as of this writing. For these cases, it might be good to manually set the ulimit the virtual memory for the specific process of your application. (If you have a leak you will see other types of errors) or using timeout

There's also manual cgroup management but then again that's exactly with docker and Kubernetes are supposed to do.

This is a good article with some insights about managing a JVM in containers.