Home > Software design >  Is there an "initial memory allocation" different from the "limit" in Openshift/
Is there an "initial memory allocation" different from the "limit" in Openshift/

Time:11-09

In java, you have min heap space ( -Xms) and max heap space ( -Xmx). Min heap space is allocated to the JVM from start, "max heap space" is the limit where the JVM will say "out of heap space" when reaching it.

Are there such different values (initial and limit) for a pod in Openshift/Kubernetes, or initial memory allocation is always equal to limit for some reason ?

CodePudding user response:

With modern Java versions (those that support UseContainerSupport), the heap allocation within a K8s or Openshift Pod is dependent on the memory available to the container.

This is solely determined by the "containers.resources.limits.memory" value (as you speculated). Other values, e.g. "containers.resources.requests.memory" don't play a part in this. If no resource limits are set, the entire memory of the respective cluster node will be used for initial heap size ergonomics, which is a sure recipe for OOM kills.

CodePudding user response:

in K8s the resources are defined as request and limit. the request is for the initial allocation and when the pod is reaching the memory limit it will get OOMKILLED and afterwards will restart so i think its the same behaviour as you described.

  • Related