1

So I've read several related threads and there seems to be no answer.

I have an old laptop, with a Dual Core 1.7 GHz processor and added 2 GB of RAM, with a 30 GB partition for Ubuntu 12.04 and the remaining for Windows XP.

I want to change the default swappiness from 60 to 0.

When I start the computer and run cat /proc/sys/vm/swappiness in Terminal I get the value 60.

I have no problems changing it to 0 with sudo sysctl vm.swappines=0

I have tried several times changing the file /etc/sysctl by adding at the end

#
# vm.swappiness=0

But every time I restart my computer the value given by cat /proc/sys/vm/swappiness is still 60.

Any ideas as to how to fix this?

Thanks

2 Answers 2

1

The line is not being applied because it's commented, instead of:

# vm.swappiness=0

It should read:

vm.swappiness=0

Try that and reboot.

2
  • Thanks darent, that did the job. The final lines of my /etc/sysctl are now # Log Martian Packets #net.ipv4.conf.all.log_martians = 1 vm.swappiness=0
    – sanwablo
    Jan 25, 2014 at 12:51
  • You can mark the answer as solved if it helped you. Another alternative solution is to comment the swap line in /etc/fstab but that would remove the computer ability to go into hibernation mode. Jan 25, 2014 at 12:54
1

I have mine set like this:

#
# Decrease swap usage to a workable level
vm.swappiness=10
# Improve cache management
vm.vfs_cache_pressure=50

I guess you can just use "0" instead of my "10", but this should work.

2
  • Thanks natkoui, but I have already fixed this with darent's answer. Very successful first question.
    – sanwablo
    Jan 25, 2014 at 12:56
  • Also, you can vote other solutions up. I just up-voted this one because it also works. Jan 25, 2014 at 12:58

You must log in to answer this question.

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