kenel memory usage question.

From: Patric Ho
Date: Tue Jun 08 2004 - 05:00:05 EST


I am working on linux used in embedded devices. I use
following method to calculate the actual amount of
memory used by kernel+processes (not including page
caches and swap is off in my system):

(from /proc/meminfo) MemTotal - MemFree - Buffers -
Cached.

I thought this should be a fairly constant number for
a minimal kernel, e.g. no network support, and
statistics are collected right after login. However
when I use different "mem=" kernel cmd-line option, I
got quite different numbers:

7M: 2580K
8M: 2612K
16M: 2648K
128M: 3584K

Any idea why this happens? I can even see "Slab:"
changes from 1220K when mem=7M to 1968K when mem=128K.
It looks like kernel can adjust memory usage depends
on the actual physical memory available. I previously
thought only page caches can shrink in such way.

Thanks a lot.

Patric





____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/