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.

Why would i get different numbers when running free -m vs system monitor? I have been running firefox with flash for a few days and my machine has gotten slow; it took all 1GB of my memory so I shut out firefox and npviewer.bin and system memory now says I am at 192Mb of ram where as free -m saids 647Mb?

Any thoughts, I would think system monitor is right.

share|improve this question
    
"system memory"? Also, it hasn't been "Fedora Core" for a few years now. –  Ignacio Vazquez-Abrams Oct 30 '10 at 1:00
    
system monitor not system memory and Fedora Core, Fedora Project, Fedora, its just a name. –  David Oct 30 '10 at 1:52

1 Answer 1

up vote 0 down vote accepted

Under any remotely sophisticated operating system, there is no clear notion of how much memory a particular application uses, or how much memory is free. The main sources of complications are:

  • If you have swap, do you include free swap space in the free memory? If you don't, what's the point of having swap? But if you do, you're likely to always have a lot of free memory, even if your system is thrashing (i.e. swapping a lot) due to the lack of RAM.
  • There are many uses for memory. The main two are memory allocated by applications, and memory devoted to disk caches. These two typically have the same order of magnitude on a non-resource-starved system. If you only count the memory that is not used for any purpose, it's normal to have very little: disk caches won't go away until there is a need for their memory. But if you include the disk caches in the free memory, you might think you can fill it all up with application memory, but then you will thrash due to the lack of disk cache.
  • Shared memory makes it difficult to count the portion of memory allocated to a particular application. Shared memory includes things like shared libraries and disk caches for files that more than one application has open.

So both numbers you report are probably right, just counting different notions of “free memory”. (And free reports several numbers; you didn't say which one 647MB is — in the -/+ buffers/cache line, disk caches count as free memory, whereas in the Mem line, they don't.)

share|improve this answer

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.