1

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?

Tristan
  • 139

1 Answers1

1

In Kubernetes, the mechanisms for controlling resources such as CPU and memory are requests and limits.

Requests are what the container is guaranteed to get. If a container requests a resource, Kubernetes will only schedule it on a node that can give it that resource.

Limits make sure a container never goes above a certain value. The container is only allowed to go up to the limit, and then it is restricted.

In case you don't specify your CPU limit:

  • The container can use all the processor resources available on the node on which it is running - because it has no upper bound on the CPU resources it can use.
  • The container is automatically assigned the default limit when it is running in a namespace that has a default CPU limit. If there is a need to change that one can use LimitRange.

In situation that you specified a CPU limit but CPU request is not specified Kubernetes automatically assigns a CPU request that matches the limit.

To learn more see this documentation and this article.

kkopczak
  • 111
  • 3