LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Memory Question (https://www.linuxquestions.org/questions/linux-software-2/memory-question-91829/)

mrnikeswsh 09-11-2003 08:34 PM

Memory Question
 
Ok... I have a AMD 1.33 chip and 256 megs of ddr.
And my mandrake 9.1 is running very..very good. (could be better...but i'm only 3 days into LINUX)

here is my QUESTION... using the command top my memory reports as
255612k total, 178920k used, 76692k free

but GKRELLM reports at 163M free?

I'm sure the command line is the correct one...but why the difference?

Brian

DrOzz 09-11-2003 09:35 PM

this is because one is reporting the accurate actual memory free, and the other one is reporting the actual memory free minus the buffered/cached memory...
so gkrellm is the one telling you your actual amount of free memory....memory management works different in linux than os's like windows by using buffers and cache...
use the command free -m in the terminal and i'll use my output to show you what your looking for...
Code:

            total      used      free    shared    buffers    cached
Mem:          628        522        105          0        143        225
-/+ buffers/cache:        154        474
Swap:        1278          8      1269

as you can see i have 628 total, and it says that 522 is used and only 105 is free....but in actuality you can see that 143 is in buffers and 225 is in cache...now if you add my free + buffer + cache you will see that it adds up to 473, which is my actual amount of memory that is not being used by anything....
which brings me to the second row, which is the line you are interested in....
which shows that i really only have 154 megs of ram used with 474 megs free....

so realating to your figures the 76megs free is probably the actual amount free minus buffers/cache...
which if you add them numbers together you'll see 163 which is what gkrellm is reporting...
so run that command and check it out, and you should notice that the top command is reporting the number in the first row under the free column, and that gkrellm will report the amount in the second row under the free column...

jailbait 09-11-2003 09:40 PM

"why the difference?"

Linux saves old programs and buffers for potential future use. So a piece of memory can be in one of three possible catagories:

1. currently in use

2. free memory

3. previously used and the data could be reused, or available as free memory.

Some memory usage programs report catagory 3 memory as free memory and some report it as in use.

amalagaura 10-31-2003 05:50 AM

Thanks for clearing that up!


All times are GMT -5. The time now is 08:43 PM.