Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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! :)

share|improve this question

migrated from stackoverflow.com Mar 3 '10 at 2:30

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

add comment

3 Answers

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

I wrote a pretty extensive blog post about this a while ago, along with tips for how to manage everything. Check it out here.

share|improve this answer
add comment

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

sudo swapoff -a
sudo swapon -a
share|improve this answer
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 '10 at 1:54
add comment

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..

share|improve this answer
    
isn't the Virtual Mem usage => SWAP usage ? –  RadiantHex Mar 18 '10 at 2:33
add comment

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.