<p>I read the following article about resource management in kubrnaties: <a href="https://home.robusta.dev/blog/kubernetes-memory-limit" rel="nofollow noreferrer">https://home.robusta.dev/blog/kubernetes-memory-limit</a></p>
<p>One of the important points there is that: &quot;memory is a non-compressible resource. Once you give a pod memory, you can only take it away by killing the pod.&quot;</p>
<p>What I am still having trouble with is what happened when the pod releases its memory, does it return to the node or still allocated to the pod?</p>
<p>For example, let's say I have a pod that is waiting for a job which comes at some interval. During the job, the memory consumption is high, but between jobs the memory consumption is low. So, when the memory consumption is low, does the memory is still allocated to the pod or it return to the resource pool of the node?</p>

Idan Aviv
<p>In Kubernetes, when a pod releases its memory, it goes back into the pool of available resources on the node.</p>
<p>Here's how it works: When a pod is up and running, it gets assigned a specific amount of memory from the node it's running on. This memory is exclusively reserved for that pod and can't be used by any other pods or processes on the same node. However, once the pod is done with its memory or if it reduces its memory usage, that memory is freed up and becomes accessible for other pods or processes on the node.</p>
<p>So, in your scenario where the memory consumption is low between jobs, the memory that was previously allocated to the pod is returned to the resource pool of the node. This means that other pods or processes running on the same node can take advantage of the available memory. Kubernetes handles all this resource management behind the scenes, making sure that resources are efficiently allocated and deallocated based on the needs of the pods and the available resources on the node.</p>
