Re: Memory leak in 2.1.54

Zlatko Calusic (Zlatko.Calusic@CARNet.hr)
09 Sep 1997 12:17:05 +0200


I'm also pretty sure last few development kernels have some big
problems with memory. Looks like kernel looses big amount of memory
(7-8 MB or even more) and never finds it back.

It's enough to execute ls -alR / to loose massive amount of memory In
fact, on 32MB machine, memory problem is so obvious that you don't
need any tool to see it (top, free or something). Machine gets slower
and you can notice it.

The following simple scenario reveals things:

Reboot to single user mode (just to be sure).

memtest 7350000: allocates as much as possible free RAM
(= 29400000 bytes on 32MB machine)

free:
total used free shared buffers cached
Mem: 30664 1980 28684 704 132 848
-/+ buffers: 1000 29664
Swap: 104796 232 104564

ls -alR /

memtest 735000: since now we don't have enough memory (memory leak!)
this will produce HEAVY swapping (use ^C to save your soul :))

free:
total used free shared buffers cached
Mem: 30664 19412 11252 716 128 872
-/+ buffers: 18412 12252
Swap: 104796 244 104552

Memory is lost! (or: "who took my 16 MB SIMM out? I paid for it, it's mine!" :) )

cat /proc/slabinfo:

slabinfo - version: 1.0
kmem_cache 22 42
tcp_open_request 0 0
sock 1 5
filp 22 42
buffer_head 9372 9408
mm_struct 6 31
vm_area_struct 72 189
files_cache 8 14
uid_cache 1 127
size-131072 0 0
size-65536 0 0
size-32768 0 0
size-16384 0 0
size-8192 0 0
size-4096 1 4
size-2048 8 16
size-1024 8 16
size-512 8 8
size-256 11 14
size-128 33 50
size-64 43571 43596
size-32 43232 43281
slab_cache 6 63

Something is in dcache, but as I recall problems with recent kernels,
dcache would shrink, but I was still missing 7-8 MB of memory.

Somebody reported this behavior few weeks ago, but nobody paid
attention. Looks like everybody runs 128-256 MB of RAM these days and
doesn't find this problem that annoying. :)

P.S. Message Cc-ed to Bill Hawes, cause I find he does great job to
make linux unconditionally stable (as he once said).
Thank you Bill for your commitment!

-- 
Posted by Zlatko Calusic           E-mail: <Zlatko.Calusic@CARNet.hr>
---------------------------------------------------------------------
	Crime doesn't pay... does that mean my job is a crime?