Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running ubuntu 8 on a 2GB laptop. Whenever I look in my system monitor, I see my memory usage is slightly below 1G. Why isn't ubuntu using the full 2GB?

Let me say that the full 2GB are recognized, i.e., the system monitor says, usign 48% of 2GB.

share|improve this question
3  
Why should it use 100% if it doesn't need? –  grawity Jun 1 '09 at 7:03
2  
Are you perhaps referring to the expectation of full RAM utilization due to the disk cache? At any rate, this question does not belong on Server Fault. –  Mihai Limbăşan Jun 1 '09 at 7:12
    
@grawity: yes, it should. for buffers and caches. –  vartec Jun 1 '09 at 9:01
add comment

5 Answers

up vote 3 down vote accepted

If you're wondering why it's not using that spare RAM as a buffer/cache, the reason is that Linux doesn't preemptively read content. If you open a few programs it will leave what it reads from those in the disk cache, but it doesn't have a feature like Superfetch from Windows Vista.

For a laptop, this is probably desirable. I doubt any Superfetch-like algorithm could predict what applications I'll use accurately enough to be worth the waste of battery if it's wrong. (Although if I just preloaded firefox I'd be extremely happy!)

share|improve this answer
add comment

What are you running on ubuntu. Are you observing any performance glitches and found that ram is not being utilized or its just general observation.

If you are worried that your ram is not being used, might be the case where it doesnt need to be used.

Try the scripts on the below link and see the utilization of Ram. Hope it will clear your confusion.

http://www.linuxatemyram.com/play.html

share|improve this answer
add comment

Well, one answer is that pages are thrown out of physical ram (paged out) because they haven't been used lately, so using that memory for disk-cache makes more sense. (because that cache is used more often.) You could try

swapoff -a

Which turns off paging. (Actually, it unmounts all paging files/partitions.) That usually causes programs to crowd out the caches, but it might also make the Out-Of-Memory killer kill a few of your hungriest processes. (Like firefox.) When you're fed up, just do

swapon -a

(Notice I said "when", not "if"...)

share|improve this answer
add comment

And you're running just ubuntu? In this case I'd be shocked if it even uses 1 GB.

Memory utilization is a function of applications running - as long as you just browse the web and read mail there's not much sense in using much memory.

I have the feeling that I do not fully understand your question. If my answer is ridiculous with regard to your problem, please rephrase...

share|improve this answer
    
Linux by design can use RAM as a disk cache, primarily to speed up disk reads. More info in my own answer. –  Alex Jurkiewicz Jun 1 '09 at 9:47
    
I know, but as the author was not giving any hint on what is running, I didn't make the assumption that there is a lot running. Actually I was hoping that my asking for rephrasing would trigger some more information. Being a fairly unspecific question I do like the answers assembled here though. Who knows - the question might still get rephrased... –  Olaf Jun 1 '09 at 19:58
add comment

As Alex says Linux does not have a preemptive caching mechanism like Vista/Win7's Superfetch so its normally only going to use memory when its actually requested. Also, depending upon the value of swappiness you have set it could very well be paging much more quickly than you necessarily need

share|improve this answer
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.