I can't set the overcommit_memory from inside the shell:
root@ubuntu:~# /proc/sys/vm/overcommit_memory = 1
-bash: /proc/sys/vm/overcommit_memory: Permission denied
Also I tried putting that line in /etc/sysctl.conf and rebooting the vm but it's not working.
Someone have some clues? I couldn't find anything searching in google.
Best Answer
Settings in /proc/sys are virtual files. To change them, you need to write to them like you would any other file, like so:
The command you tried is to run
/proc/sys/vm/overcommit_memory
as an executable, which of course is impossible. The "Permission denied" you're getting is because that file is not set as executable, not because you can't change it.You can see the current setting by reading the file: