Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Nov 8 '09 at 20:55

This question came from our site for professional and enthusiast programmers.

    
What are you expecting to happen differently that is not? I suspect this setting is not what you think it is. –  Jeff Snider Nov 8 '09 at 23:51
    
thank you for the edit Iain! lol –  makevoid Nov 5 '11 at 3:09

3 Answers 3

up vote 4 down vote accepted

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
share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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