Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Lately I've been noticing that my monitoring script which reads from /proc/meminfo and /proc/<pid> has been showing odd readings, where several hundred MB seem to be missing. htop is showing the same discrepancy:

CPU: 36.9% sys:  7.6% low:  0.0%                        Tasks: 123; 1 running
Mem:1750M used:1568M buffers:20M cache:87M              Load average: 0.90 1.33 1.33 
Swp:1787M used:184M                                     Uptime: 1 day, 00:28:22
  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 3455 rena       20   0 1221M  312M 20464 S 14.0 17.8  1h20:26 /usr/lib/firefox/firefox
 1428 root       20   0  327M  100M  6236 S  7.0  5.7  1h28:52 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nol
14012 rena       20   0  630M 26400  5264 S  0.0  1.5  0:14.20 /usr/bin/python /usr/bin/sonata --toggle
 2562 rena       20   0  914M 21100 10904 S  0.0  1.2  3:59.50 xfce4-terminal --role "Terminal" --hide-menubar -
 2492 rena       20   0  379M 20528  3312 S  0.0  1.1  0:03.53 pcmanfm --desktop --profile lubuntu

Memory used is 1568M, but the top 5 processes aren't using anywhere near that: 312+100+26+21+20+20(buffers)+87(cache) = 586M. So 982M are missing somewhere?

OS is Lubuntu 12.04 AMD64.

Contents of /proc/meminfo:

MemTotal:        1792540 kB
MemFree:           67824 kB
Buffers:           17084 kB
Cached:           109624 kB
SwapCached:        69600 kB
Active:           436880 kB
Inactive:         245756 kB
Active(anon):     402348 kB
Inactive(anon):   169616 kB
Active(file):      34532 kB
Inactive(file):    76140 kB
Unevictable:       13456 kB
Mlocked:           13456 kB
SwapTotal:       1830908 kB
SwapFree:        1632380 kB
Dirty:                40 kB
Writeback:             0 kB
AnonPages:        515492 kB
Mapped:            46852 kB
Shmem:              3308 kB
Slab:             875752 kB
SReclaimable:      19108 kB
SUnreclaim:       856644 kB
KernelStack:        2688 kB
PageTables:        19468 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2727176 kB
Committed_AS:    1741500 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      285612 kB
VmallocChunk:   34359436336 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:     1551232 kB
DirectMap2M:      282624 kB

Head of slabtop (by size):

 Active / Total Objects (% used)    : 1859056 / 1873931 (99.2%)
 Active / Total Slabs (% used)      : 115960 / 115960 (100.0%)
 Active / Total Caches (% used)     : 76 / 108 (70.4%)
 Active / Total Size (% used)       : 906258.20K / 909988.65K (99.6%)
 Minimum / Average / Maximum Object : 0.01K / 0.49K / 8.00K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
1640475 1640475 100%    0.53K 109365       15    874920K idr_layer_cache
  4941   4628  93%    0.86K    549        9      4392K ext4_inode_cache
 19068  13243  69%    0.19K    908       21      3632K dentry
  6034   5325  88%    0.55K    431       14      3448K inode_cache
 20272  20272 100%    0.14K    724       28      2896K sysfs_dir_cache
share|improve this question
    
Could you run a slabtop -s c to see what's in there? (SUnreclaim looks high in your meminfo.) –  Mat May 31 '12 at 7:56
    
pastebin.com/wmJSkx4S that does add up to about 982M, but why? o.O –  Rena May 31 '12 at 8:00
    
Any unusual modules or programs running? That idr_layer_cache thing is very strange. –  Mat May 31 '12 at 8:18
    
Nothing sticks out in lsmod. I have a funny feeling the radeon driver is responsible though... it's given me a lot of grief already. –  Rena Jun 1 '12 at 5:41

2 Answers 2

up vote 0 down vote accepted

This seems to be a confirmed bug on launchpad. It's also affecting my system.

https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1047566

share|improve this answer

This might be due to Page Cache. If that is the case, forcing the kernel to drop the page caches will free a significant amount of memory.

# echo 1 > /proc/sys/vm/drop_caches
share|improve this answer
    
The output in the question indicates the cache size is somewhat small ( ~100MB ). –  psusi May 31 '12 at 22:14
    
That doesn't appear to have had any effect. –  Rena Jun 1 '12 at 6:28
    
Yes indeed, the effect will be negligent if the size of the dirty cached pages is small. This does not seem to be the problem in your case. My wrong -did not examine thoroughly your /proc/meminfo. –  dkaragasidis Jun 1 '12 at 7:39

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.