<p>I feel like I am misunderstanding RAM based <code>emptyDir</code> volumes in Kubernetes.</p>
<ol>
<li><p>Let's suppose my Kubernetes node has a total of 100GB. If I have 4 different emptyDirs that have <code>emptyDir.medium</code> set to &quot;Memory&quot;, by default will they all have 50GBs of memory? In that case what happens when the total amount of memory used in my 4 emptyDirs exceeds 100GB?</p>
</li>
<li><p>I know in general RAM is fast, but what are some examples for the downsides? From the <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="nofollow noreferrer">official documentation</a>, I see the below but I don't quite understand the statement. My understanding is that if a Pod crashes, files on emptyDirs using disk will still be deleted. Will the files be kept upon node reboot if they are stored in disk? Also what do they mean by <code>count against container memory limit</code>?</p>
</li>
</ol>
<pre><code>While tmpfs is very fast, be aware that unlike disks, 
tmpfs is cleared on node reboot and any files you 
write count against your container's memory limit
</code></pre>

<p><code>...by default will they all have 50GBs of memory?</code></p>
<p>Yes. You can exec into the pod and check with <code>df -h</code>. If your cluster has <code>SizeMemoryBackedVolumes</code> feature enabled, you can specify the size.</p>
<p><code>...what happens when the total amount of memory used in my 4 emptyDirs exceeds 100GB?</code></p>
<p>You won't get that chance because the moment the total amount of memory used by all emptyDir(s) reach 50GB; your pod will be evicted. <strong>It doesn't need a single emptyDir to reach 50GB to evict</strong>.</p>
<p><code>...don't quite understand the statement.</code></p>
<p>It means you will not get back the data storing on emptyDir.</p>
<p><code>count against container memory limit</code></p>
<p>It means the amount of memory that you consumed using emptyDir is added to the amount of the memory that your container used and check against the resources.limits.memory.</p>
