Skip to contentSkip to conversation

Possible cache memory leak.

BUG Michał Kazior 1 participant 1 message Sep 21, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I've discovered a strange thing lately. My memory is being sucked out when doing (I suppose) _a lot_ of stat() on the file system. I got left once with ~30MB of ram (of 512 in total) which made my system trash like hell. You might try doing the following to reproduce the effect:

 $ echo 1 > /proc/sys/vm/drop_caches
 $ vmstat                            # write down the result
 $ du -s -x /lots/of/files           # keep it running for a minute
 $ echo 1 > /proc/sys/vm/drop_caches
 $ vmstat                            # write it down too

The latter vmstat should report less memory then the previous one. (sum up free+buff+cache) Is this an expected behaviour ? If yes, please explain.

The memory can be magically freed by umount-ing the partition that was scanned or by deleting the files that were stat()-ed. However, one cannot simply umount "/".

Note: Make sure you point 'du' to a place where you have dozens of files, so it can keep it running for a minute or more.

I can confirm that to be an issue to 2.6.23-rc6 and 2.6.23-rc7. A friend of mine reports that 2.6.22.5 produces same results. Tested on jfs and ext3.

Regards,
Michał Kazior.

PS. I'm not subscribed to the list, so CC me please.