Skip to main content

Posts

Showing posts from September, 2020

Is your VM really running out of memory?

Every so often, I get fooled by the scary-looking rising memory graphs on my puny minimum sized VM running on Digital Ocean. The same thing seems to happen to my colleagues and I have to go into this discussion on memory usage on virtual machines and on work laptops. I'm not an expert on the topic but I have gathered here a couple of things to demystify the issue. The first question I ask myself or a fellow developer is: what do you mean by running out of memory? You are most likely talking about memory pressure, right? What are the symptoms? Is it just a gut feeling or is there some verifiable performance degradation? After that, we could talk about a few seemingly counter-intuitive topics The "raw" memory usage should be high. Especially on a busy VM, it is good that frequently used files are mapped to memory. The OS does not know when it is out of memory. The Linux kernel allocates memory until it can't. You probably should have swap on Before one goes digging into...