0

I need to keep my remote machine from swapping (will not respond to ssh anymore). Therefore I set ulimit -Sv 300000; ulimit -Hv 300000. It is laborious to do this manually, so I want to set it permanently.

In Permanently set process limit it is suggested to set the parameter in etc/security/limits.conf.

However looking at the manpages http://manpages.ubuntu.com/manpages/bionic/man5/limits.conf.5.html

I can not find an entry for virtual memory.

How can I set the virtual memory limits for users permanently?

I am on Ubuntu Version="18.04.5 LTS (Bionic Beaver)"

0-_-0
  • 101
  • 1
    Any question should always include the version of Ubuntu you are using. Please edit the question or add a flag. What version is it? – David Jan 27 '21 at 10:17
  • There's "address space limit", and virtual memory is the addressable memory. – muru Jan 27 '21 at 10:38
  • If all you need is to stop swapping, comment out the entry for the swap partition / file in /etc/fstab and reboot. It's as simple as that. – Raffa Jan 27 '21 at 10:39

1 Answers1

1

There must be a better way, but I put ulimit -v SIZE in .bash_profile.

UNIX
  • 11