How does gnome system monitor calculates the amount of used memory? I tend to trust the values displayed by the system monitor because are consistent and do agree with the amount of ram used when running a test an application. However when I compare those values with the numbers displayed in /proc/meminfo I see no connection at all. Currently on my laptop I have 3.5 GB of ram and the amount of used memory is shown to be 814 MB. On the other hand here is what /proc/meminfo shows:
MemTotal: 3715348 kB MemFree: 923216 kB Buffers: 154144 kB Cached: 1804380 kB SwapCached: 0 kB Active: 1190432 kB Inactive: 1331876 kB Active(anon): 609064 kB Inactive(anon): 83176 kB Active(file): 581368 kB Inactive(file): 1248700 kB Unevictable: 32 kB Mlocked: 32 kB SwapTotal: 2104476 kB SwapFree: 2104476 kB Dirty: 132 kB Writeback: 0 kB AnonPages: 563820 kB Mapped: 137208 kB Shmem: 128456 kB Slab: 108932 kB SReclaimable: 77224 kB SUnreclaim: 31708 kB KernelStack: 3000 kB PageTables: 27924 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 3962148 kB Committed_AS: 1870184 kB VmallocTotal: 34359738367 kB VmallocUsed: 379280 kB VmallocChunk: 34359259364 kB HardwareCorrupted: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 8688 kB DirectMap2M: 3840000 kB
Best Answer
Compare what System Monitor shows to
$ free -m
The amount shown as "in use" by System Monitor is the amount in the second line of output from
free
. AFAIK, this is the amount of RAM actually used, excluding what is cached.free -m
often shows much more as "used" (first line of output) because it includes that used by the cache. This is not necessarily a bad thing, as empty/unused RAM is wasted RAM; rather have it "in use" as cache than sitting empty.