Linux memory reporting discrepancy -


I am getting memory usage discrepancy between meminfo and ps free PS According to reporting very little free memory than processes Has been doing.

The free, I have only 3188 MB Free:

  Free M Total use free shared buffers cached Mem: 15360 13273 2086 0 79 1022 - / + buffers / Cache: 12,171 3188 Swap: 0 0   

I try to track down where memory is using ps (shrink value less than non rss):

  ps -a --sort -rss -o com, pmem, RSS COMMAND% member RSS mysqld 13.1 2,062,272 Java 6.2 978 072 ruby ​​0.7 114 248 ruby ​​0.7 114,144 squid 0.1 30,716 ruby ​​0.0 11,868 apache2 0.0 10132 apache2 0.0 9092 Apache2 0.0 8504 PassengerHelper 0 .0 5784 sshd 0.0 3008 apache2 0.0 2420 apache2 0.0 2228 Bash 0.0 2120 sshd 0.0 1708 rsyslogd 0.0 1164 PassengerLoggin 0.0 880 ps 0.0 844 dbus- daemon 0.0 736 sshd 0.0 736 ntpd 0.0 664 squid 0.0 584 Cron 0.0 532 ntpd 0.0 512 exim4 0.0 504 nrpe 0.0 496 PassengerWatchd 0.0 416 dhclient3 0.0 344 mysqld_safe 0.0 316 unlinkd 0.0 284 Logger 0.0 252 init 0.0 200 Getty 0.0 120   

However, as adding RSS column only about Total memory usage of> 3287mb which is approximately 12gb free!

I am using kernel 2.6.16.33-xenU # 2 SMP x86_64 on Amazon AWS.

Where's my memory going? Does anyone put some light on tracking it down?

slab cache ( slab: , SReclaimable: And SUnreclaim: in / proc / meminfo ). This is a cache of in-kernel data structures, and the page cache is different from the report by free .

If the slab cache is responsible for a large part of their "missing memory", check / proc / slabinfo it is to see where it is if it's teeth or ions , You can use sync; Echo 2 & gt; / Proc / sys / VM / drop_caches to get rid of them.

You can also use the slabtop tool to show the current usage of the slab cache in a friendly format c sort the list from the current cache size will do it.

Comments