1

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.

1
  • What are you expecting to happen differently that is not? I suspect this setting is not what you think it is. Nov 8, 2009 at 23:51

3 Answers 3

5

Settings in /proc/sys are virtual files. To change them, you need to write to them like you would any other file, like so:

echo 1 >/proc/sys/vm/overcommit_memory

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:

cat /proc/sys/vm/overcommit_memory
1

Thank you jeff, i tried:

echo 1 > /proc/sys/vm/overcommit_memory

but:

-bash: echo: write error: Operation not permitted

the problem was that the ability to write the file was 'locked' by the VM server so I had to ask the sysadmin to enable it

on an unix box at home where i installed VMWare server i tried it and it worked either mine and your solution.

-1

First you should use the command cat /proc/mounts.

If the mount point /proc was mounted in read only mode, then you must remount it.

Try remounting with the command mount -o remount,rw /proc.

After remount, try using the echo command again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .