<p>In java, you have min heap space ( -Xms) and max heap space ( -Xmx). Min heap space is allocated to the JVM from start, &quot;max heap space&quot; is the limit where the JVM will say &quot;out of heap space&quot; when reaching it.</p>
<p>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 ?</p>

Tristan
<p>With modern Java versions (those that support <code>+UseContainerSupport</code>), the heap allocation within a K8s or Openshift Pod is dependent on the memory available to the container.</p>
<p>This is solely determined by the &quot;containers.resources.limits.memory&quot; value (as you speculated). Other values, e.g. &quot;containers.resources.requests.memory&quot; 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.</p>
