title: Does Kubernetes consider the current memory usage when scheduling pods
body: <p>The Kubernetes docs on <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" rel="noreferrer">https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/</a> state:</p>
  
  <blockquote>
    <p>The scheduler ensures that, for each resource type, the sum of the resource requests of the scheduled Containers is less than the capacity of the node.</p>
  </blockquote>
  
  <p>Does Kubernetes consider the current state of the node when calculating capacity? To highlight what I mean, here is a concrete example:</p>
  
  <p>Assuming I have a node with 10Gi of RAM, running 10 Pods each with 500Mi of resource requests, and no limits. Let's say they are "bursting", and each Pod is actually using 1Gi of RAM. In this case, the node is fully utilized (<code>10 x 1Gi = 10Gi</code>), but the resources requests are only <code>10 x 500Mi = 5Gi</code>. Would Kubernetes consider scheduling another pod on this node because only 50% of the memory capacity on the node has been <code>requested</code>, or would it use the fact that 100% of the memory is currently being utilized, and the node is at full capacity?</p>