0

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.

flybywire
  • 587
  • 4
  • 9
  • 20

5 Answers5

3

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

Alex J
  • 2,804
  • 2
  • 21
  • 24
2

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

Viky
  • 638
  • 2
  • 7
  • 11
1

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

Anders Eurenius
  • 294
  • 1
  • 4
0

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

Olaf
  • 908
  • 5
  • 7
  • Linux by design can use RAM as a disk cache, primarily to speed up disk reads. More info in my own answer. – Alex J Jun 01 '09 at 09: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 01 '09 at 19:58
0

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