0

I rent a shared VPS that runs Debian 9. I am alloted 4GB RAM (4096MB), but sometimes my processes go over 4GB. This is largely due to the kernel caching a lot of my stuff, so I'd like to know if I can limit the kernel to 4GB so that when I need more RAM, it clears the buff/cache to ensure I don't go over 4GB. Mem usage free -m

Rontron
  • 111
  • If you paste text as text, then +1. As it is blind people can not read the text. (A description alt-text for the remaining image would also be nice, but you will get my +1 without it). – ctrl-alt-delor Jul 31 '18 at 16:55

1 Answers1

2

You already are limited to 4 GiB of memory; that’s what the “4096” value in the output of free -m means. Your graph is no doubt taking swap into account too, so when you see memory usage go over 4 GiB it’s because the sum of memory and swap used is greater than 4 GiB. (Either that, or it’s using powers of 10 rather than powers of 2.)

Stephen Kitt
  • 434,908
  • What is swap? Does it likely count against my 4GB plan that I pay for? – Rontron Jul 31 '18 at 16:59
  • Swap is disk space which is used to supplement RAM in certain circumstances (see here for details). It won’t count against the 4 GiB you’re paying for. It would be very unusual for a VPS to allow you to allocate more than you’re paying for, at least in my experience. – Stephen Kitt Jul 31 '18 at 17:01