<p>In openshift, how can I enlarge memory usage for an existing pod from 2GB to 16GB? As currently I always get run out of memory.</p>

william007
<p>You can change the OOM limitation as &quot;1.&quot; process, and lower OOM priority through &quot;2.&quot; process.</p>
<ol>
<li>Check if &quot;resources.limits.memory&quot; of your pod is configured sufficient size or not.</li>
</ol>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: frontend
spec:
  containers:
  - name: db
    image: mysql
    resources:
      requests:
        memory: &quot;2Gi&quot;
      limits:
        memory: &quot;16Gi&quot;     &lt;--- If this memory usage is reached by your application, triggered the Out of Memory event. 
:
</code></pre>
<ol start="2">
<li>Configure the same size with &quot;resources.requests.memory&quot; and &quot;resources.limits.memory&quot; for lowest priority of the OOM.
Refer <a href="https://docs.openshift.com/container-platform/3.11/admin_guide/overcommit.html#qos-classes" rel="nofollow noreferrer">Quality of The services</a> for more details.</li>
</ol>
<pre><code>// If limits and optionally requests are set (not equal to 0) for all resources and they are equal, 
// then the container is classified as Guaranteed.

apiVersion: v1
kind: Pod
metadata:
  name: frontend
spec:
  containers:
  - name: db
    image: mysql
    resources:
      requests:
        memory: &quot;2Gi&quot;  &lt;--- set the same size for memory
      limits:
        memory: &quot;2Gi&quot;  &lt;--- in requests and limits sections
:
</code></pre>
