Re: kenel memory usage question.

From: Denis Vlasenko
Date: Tue Jun 08 2004 - 05:42:02 EST


On Tuesday 08 June 2004 12:57, Patric Ho wrote:
> 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

some data tables are sized differently depending on RAM
size (TCP hash table etc. look into dmesg)

> 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.
--
vda
-
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/