PDA

View Full Version : [all variants] Swap?



OpenSourceRules
June 8th, 2012, 05:50 AM
Although I rarely ever reaches 1G of the 2G of RAM on my laptop, swapless installations usually result in slow or unstable system.

I guess swap is not only used to back up RAM, it is used as a stabilizer, too.

wilee-nilee
June 8th, 2012, 06:01 AM
Although I rarely ever reaches 1G of the 2G of RAM on my laptop, swapless installations usually result in slow or unstable system.

I guess swap is not only used to back up RAM, it is used as a stabilizer, too.

You can change the swappiness.

Blackbird_13
June 8th, 2012, 06:28 AM
To change "swappiness":

gksudo gedit /etc/sysctl.confSearch for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:

vm.swappiness=10Save the file and reboot.
swappiness can have a value of between 0 and 100
swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
Source:

https://help.ubuntu.com/community/SwapFaq#What_is_swappiness_and_how_do_I_change_it. 3FI always set swappiness=0

gnorb
June 8th, 2012, 09:00 AM
Thanks for the swapiness information and link!

I had a look at the swap usage yesterday. Due to the reason that my 10" Acer Aspire One, now upgraded to 12.04 with unity, is very slow when switching between users.

The 1G RAM is near used up with only one user logged in and the swap seems unused. Still with two users the situation looks to be the same.

Shouldn't swap be in more active use while switching between users?

Blackbird_13
June 8th, 2012, 09:13 AM
I'm using just over 400MB at the moment, which is pretty usual for me. Do you know what is using up your RAM?
Since installing 12.04 I find my system very slow switching between users. This was not the case in lucid.

gnorb
June 12th, 2012, 08:24 AM
Changed swapiness from 60 to 10 now. The usage may feel a bit faster but I haven't been able to measure the difference, just watching free & top now and then.

Actually the /etc/sysctl.conf file didn't include the swapiness line by default. Just added the line to the end.

Looking more closely, the high memory usage was just reserved buffered & cache. At least this has confirmed that the slow 12.04 unity on my laptop is not depending on memory size now.