2001-02-03 14:16:02

by Ricardo Galli

[permalink] [raw]
Subject: 2.4.1 eats RAM or /proc/meminfo bug

I noticed in my server that the memory consumption with 2.4.1 it much higher
than 2.2.18 and it gets worse over time.

Free was reporting up to 140MB of RAM with no user/X session (50-60MB with
2.2.18, same software). I've upgraded to procps 2.0.7, but the problem
persists. After few minutes of rebooting the server, the memory usage was
40-50MB, but after 24 hours the used memory grew to 120MB. I though it could
be Apache or Postgres servers, so I've stopped them but the memory decreased
just few megabytes.

I did then another check, I summed the RSS of all processes (which should
give more than free) and it is reporting _less_ that free.

Find the figures and sys info below. Please note that the used memory it's
about 120MB, with 2.2.x it never passed 60MB with the same conf.

[root@m3d /root]# uname -a
Linux m3d.uib.es 2.4.1 #2 Thu Feb 1 12:22:17 MET 2001 i686 unknown

[root@m3d /root]# free -V
procps version 2.0.7

[root@m3d /root]# free
total used free shared buffers cached
Mem: 255340 232444 22896 0 16988 93212
-/+ buffers/cache: 122244 133096
Swap: 208804 0 208804

[root@m3d /root]# cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 261468160 238030848 23437312 0 17395712 95453184
Swap: 213815296 0 213815296
MemTotal: 255340 kB
MemFree: 22888 kB
MemShared: 0 kB
Buffers: 16988 kB
Cached: 93216 kB
Active: 15424 kB
Inact_dirty: 92172 kB
Inact_clean: 2608 kB
Inact_target: 60 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 255340 kB
LowFree: 22888 kB
SwapTotal: 208804 kB
SwapFree: 208804 kB

[root@m3d /proc]# modprobe -l
/lib/modules/2.4.1/kernel/drivers/net/dummy.o
/lib/modules/2.4.1/kernel/drivers/net/eepro100.o
/lib/modules/2.4.1/kernel/drivers/parport/parport.o
/lib/modules/2.4.1/kernel/drivers/parport/parport_pc.o
/lib/modules/2.4.1/kernel/drivers/sound/ac97_codec.o
/lib/modules/2.4.1/kernel/drivers/sound/ad1848.o
/lib/modules/2.4.1/kernel/drivers/sound/es1370.o
/lib/modules/2.4.1/kernel/drivers/sound/es1371.o
/lib/modules/2.4.1/kernel/drivers/sound/esssolo1.o
/lib/modules/2.4.1/kernel/drivers/sound/maestro.o
/lib/modules/2.4.1/kernel/drivers/sound/mpu401.o
/lib/modules/2.4.1/kernel/drivers/sound/sound.o
/lib/modules/2.4.1/kernel/drivers/sound/soundcore.o
/lib/modules/2.4.1/kernel/drivers/sound/sscape.o
/lib/modules/2.4.1/kernel/fs/msdos/msdos.o
/lib/modules/2.4.1/kernel/fs/vfat/vfat.o


[root@m3d /root]# ps axlh | awk '{i+=$7; j+=$8}; END{ print i, j }'
254592 99748

Note in the last command that the total RSS is lower thet the used memory
reported by free/meminfo. The machine is a plain PIII with IDE disks adn
3Com905 etherboard.

Just tell me if you need for info or reports.

Regards.

--ricardo
http://m3d.uib.es/~gallir/



2001-02-03 18:28:23

by Ricardo Galli

[permalink] [raw]
Subject: RE: 2.4.1 eats RAM or /proc/meminfo bug

> you should give up thinking there's any real relation between 2.2
> and 2.4. yes, they're both Linux, but their behaviors are essentially
> unrelated.
>
> > total used free shared buffers
> cached
> > Mem: 255340 232444 22896 0 16988
> 93212
> > -/+ buffers/cache: 122244 133096
> > Swap: 208804 0 208804
>
> no swap in use, so there's no problem. except that 22MB is free/wasted.


Then, who is using those 122,244 KB of RAM than cannot be otherwise used for
buffers/cache?

Perhaps I am wrong and that number is the sum of procs memory plus
buffer/caches, but then it should have more free RAM than show in
free/meminfo. And altough cache and buffers are more or less stable, the
reported "used" memory" is still increasing.

What I understand is (no accounting for swap):

cache+buffers == active+inact_dirty+inact_clean.
userland mem == total - (kernel + cache + buffers)

but my reported numbers don't match. I am doing against the maths with the
current situation, and they still worse, buffers/cache have increased in
~4MB but free memory has decreased in ~14MB (with the same workload and
processes):

[gallir@m3d gallir]$ free
total used free shared buffers cached
Mem: 255340 246816 8524 0 4048 110736
-/+ buffers/cache: 132032 123308
Swap: 208804 0 208804

It's preferable to use all available RAM for buffers/cache, but this isn't
the case...

Sorry if I am wrong, I couldn't find more related docs about these changes.

--ricardo