[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 574
  • Last Modified:

Difference between system monitor and /proc/meminfo

I'm monitoring memory usage in a CentOS 5.2 instance and I'm noticing a big difference between the utilization reported by the system monitor gui and /proc/meminfo from the command line.

Here's the system monitor which shows 1.4 GB free:

 screen shot
Here's the contents of /proc/meminfo which shows 378 MB free:

 
[ollie@testdataload ~]$ cat /proc/meminfo
MemTotal:      4044272 kB
MemFree:        378764 kB
Buffers:         10124 kB
Cached:         999056 kB
SwapCached:          4 kB
Active:        3448596 kB
Inactive:        43812 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:      4044272 kB
LowFree:        378764 kB
SwapTotal:     2064376 kB
SwapFree:      2064224 kB
Dirty:           24256 kB
Writeback:          20 kB
AnonPages:     2483224 kB
Mapped:          94308 kB
Slab:            94700 kB
PageTables:      34528 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   4086512 kB
Committed_AS:  3647660 kB
VmallocTotal: 34359738367 kB
VmallocUsed:    271788 kB
VmallocChunk: 34359465687 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

Open in new window


Can someone explain the difference between the two? If I was a betting man I would guess that the command line info is the more accurate one.

BTW, this is a vwmare guest image running on a windows 2008 host.
0
opike
Asked:
opike
  • 2
  • 2
1 Solution
 
themrrobertCommented:
I believe that from meminfo like the free command you add cached + free to get total available memory
0
 
themrrobertCommented:
ps, cached contains recently used programs etc in the ram so that if you run them again it runs lightning quick, this memory is technically free since if a program requests it, the memory is used, and the program will have to be run from disk the next time :)

hope i helpd
0
 
mohansahuCommented:
Hi,

1 .Generally, Linux system memory is used by the kernel for two purposes: processes and file/network cache/buffers. If you look closely at the output of free, Have a look in ur free command and compare as below:

2.If you add "buffers" and "cache", and then subtract that from the "used" column, you'll get the second line under "used" (the line that starts with '-/+ buffers/cache'), which shows about 1.4G (1433.6) in use (In ur case), which matches the reported memory in use that System Monitor is reporting (it is ignoring the buffers/cached because those will go away to make room for more processes)

MS

0
 
mohansahuCommented:
Your grep against /proc/meminfo actually matches the first line's "free" column (1433.6) is close enough to 1433. -- it likely changed between the two command outputs).

MS
0

Featured Post

New Tabletop Appliances Blow Competitors Away!

WatchGuard’s new T15, T35 and T55 tabletop UTMs provide the highest-performing security inspection in their class, allowing users at small offices, home offices and distributed enterprises to experience blazing-fast Internet speeds without sacrificing enterprise-grade security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now