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

  • 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

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.)

  • What is swap? Does it likely count against my 4GB plan that I pay for? – GShocked 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.