4

Current statistics affirm that:

100Mb of RAM are used out of 312Mb and 31Mb of Virtual Mem are used too.


Anyway I can stop the OS from using virtual memory instead of RAM? I know that this happens when RAM becomes saturated, and OS has nowhere else to store data other than the hard disk. But the Virtual mem doesn't seem to go down, instead it looks like it prefers staying there.


I'm not sure if this is a problem or not, as maybe it doesn't necessarily mean that the virtual mem is being used over the ram.

Help would be much appreciated! Thanks! :)

3 Answers 3

6

Check out your swappiness value in /proc/sys:

$ cat /proc/sys/vm/swappiness
60

You can force Ubuntu not to use swapfile until absolutely necessary by changing this value to zero:

$ sudo sysctl vm.swappiness=0
vm.swappiness = 0
3

You can clear out the swap by using these two commands in order:

sudo swapoff -a
sudo swapon -a
1
  • 2
    This clears the swap, but doesn't prevent anything from immediately reclaiming it. Also, it can be a Very Bad Idea if there isn't enough space to write the swap back out.
    – John Feminella
    Mar 3, 2010 at 1:54
0

To quote you :

100Mb of RAM are used out of 312Mb and 31Mb of Virtual Mem are used too.

You've not yet mentioned SWAP usage and have only mentioned that a 1/3 of your RAM is used.

Onee important thing to keep in mind on Linux systems, is that you're RAM will often times look "more used" that it really is since the Kernel will use ram for whatever it can to make your life faster ( ex.: filesystem information / inode cache / etc... ). This is not overly problematic as this buffered information is considered as being a second class citizen and will be bumped down if need be..

1
  • isn't the Virtual Mem usage => SWAP usage ?
    – RadiantHex
    Mar 18, 2010 at 2:33

You must log in to answer this question.

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