Memory usage: what's telling the truth?
On my system, I get the following results for memory usage
"free" command: 210MB, 473 including buffers and cache "top" command: 370MB gnome-system-monitor: 180MB So, what's the true story? |
what's the exact output free -m?
|
I've just got this
bash-3.2$ free -m total used free shared buffers cached Mem: 1136 261 874 0 12 147 -/+ buffers/cache: 101 1034 Swap: 0 0 0 Evidently things are never the same two days running! |
Your free memory is 1034. There was a really informative article about making sense of 'free' posted here on LQ some time ago. I can't seem to find it.
|
|
Quote:
|
I understand what "free" does. My point was that different tools disagreed with one-another.
In fact, a closer look at "top" and "free" shows they are in agreement. It's gnome-system-monitor that's out of step; it should show more memory in use than "free", as it's using memory to run, yet it shows less. The moral would appear to be "Beware of GUI tools and always trust your CLI." |
What version of gnome-system-monitor are you using? In mine, when I look under the Resources tab, it shows 1.8GB used. When I type "free -m" it says 3852 (3.8GB) used, but 1807 (1.8GB) used for the "-/+ buffers/cache" row which is the one we really want. Top of course shows 3.8GB being used, and is scary (I don't like it). Basically my gnome-system-monitor is running correctly (at least to what the user wants to know). In Help->About I get version "System Monitor 2.28.0".
Additionally, you might want to look at ksysguard, which is the KDE process manager, which is good in its own ways (allows tree-view of process list and a few other cool things), but worse than gnome-system-monitor in others, and doesn't require you to be in KDE to use; you can just install it from the package manager. |
If you run top and you see these lines:
Mem: 2062712k total, 2010384k used, 52328k free, 248168k buffers Swap: 0k total, 0k used, 0k free, 1619436k cached MEM is the total memory you have. USED is used memory plus memory in cache. CACHED is memory that is not being used by an app but is in cache ready to use. So in my example 443276 is being used by the system. At least this is how I interpret it. If Im wrong maybe someone will correct me. |
This is closer to the correct description of buffers and cache.
|
Quote:
Code:
SHR indicates how much of the VIRT size is actually sharable memory or libraries). I think SHR is the sharable portion of RES. I don't know how to tell for sure. But I haven't seen any cases that can be easily shown to contradict the idea that SHR is the sharable portion of RES. I also dislike the sentence from that page Code:
VIRT stands for the virtual size of a process, which is the sum of memory it is actually using Regarding the details of Buffers and Cache in that page, I don't know enough and/or didn't read carefully enough to comment on whether the page is accurate. |
All times are GMT -5. The time now is 09:25 PM. |