<p>Trying to keep track of memory usage for a pod in k8s. Does the metric kubernetes.pod.memory.usage counts cached/buffer size? If yes, which metric should I use to keep track of actual memory usage</p>

shakalaka
<ol>
<li>Does the metric kubernetes.pod.memory.usage counts cached/buffer size? The answer is <strong>Yes</strong>.</li>
</ol>
<p><a href="https://i.stack.imgur.com/VHTHE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VHTHE.png" alt="enter image description here" /></a></p>
<ol start="2">
<li>Which metric should I use to keep track of actual memory usage? <code>container_memory_working_set_bytes</code></li>
</ol>
<p><a href="https://faun.pub/how-much-is-too-much-the-linux-oomkiller-and-used-memory-d32186f29c9d" rel="nofollow noreferrer">The article</a> is recommended to you:</p>
<blockquote>
<p>You might think that memory utilization is easily tracked with <code>container_memory_usage_bytes</code>, however, this metric also includes cached (think filesystem cache) items that can be evicted under memory pressure.The better metric is <code>container_memory_working_set_bytes</code> as this is what the OOM killer is watching for.</p>
</blockquote>
