krish – 起死回生 [Wake up from death & return to life.]

November 24, 2011

Linux swapping even if RAM is available..

Filed under: GNU/Linux — krish @ 3:27 pm
Tags: , , , , ,

I noticed this after a very long time, on my laptop today…thought I’d just blog up what to do about it 🙂

krish@shenron:~$ free
total used free shared buffers cached
Mem: 5717368 1556752 4160616 0 32116 295768
-/+ buffers/cache: 1228868 4488500
Swap: 4296696 156708 4139988

So, that’s pretty much more than 2/3 rds of RAM available, but the swap is being used already.

This setting is controlled by ‘vm.swappiness’
krish@shenron:~$ sysctl -A | grep "vm.swappiness"
vm.swappiness = 60

or you could find the value in
krish@shenron:~$ cat /proc/sys/vm/swappiness
60

The default value is 60.
A value of 0 means “never use swap till RAM is available“ .
A value of 100 would mean “swap as soon as possible”.

Using 0 is bit hard on the machine 😀 , let’s use a value of 10
krish@shenron:~$ sudo sysctl -w vm.swappiness=10
[sudo] password for krish:
vm.swappiness = 10
.
krish@shenron:~$ sudo sysctl -A | grep "vm.swappiness"
vm.swappiness = 10

This value is not persistent on reboot unless you write it to /etc/sysctl.conf 😉

Advertisements

1 Comment »

  1. source website

    Linux swapping even if RAM is available.. | krish – 起死回生 [Wake up from death & return to life.]

    Trackback by source website — September 23, 2014 @ 9:31 pm


RSS feed for comments on this post. TrackBack URI

Please leave a Reply / Discuss this topic here :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

The Male Factor

On behalf of the ignored gender

Rough Draft

by Atteris Amarth and Darrek Ringo

The Kochi Post.

Read by all + Influenced by none

JumboMake

A signature of Kiran

SAAYAM CHEDDAM FOUNDATION

This blog is just for additional and extension share of it's main frames. No activity is planned from here

krish - 起死回生 [Wake up from death & return to life.]

Get a sneak peek into krish's life, work and passion.

WordPress.com

WordPress.com is the best place for your personal blog or business site.

A Tale of Two and a Half

Monika Amita Bakshi

%d bloggers like this: