Mem leak in linux kernel 2.4.x SMP?

bubba

Golden Member
Oct 10, 1999
1,589
0
0

When I reboot my box (RedHat 7, 2.4.2 kernel) I get the following mem usage:

[root]# free -m
total used free shared buffers cached
Mem: 311 37 274 0 1 17
-/+ buffers/cache: 18 293
Swap: 509 0 509



Now, if I leave it overnight I get the following in the morning:

[root]# free -m
total used free shared buffers cached
Mem: 311 279 32 0 84 23
-/+ buffers/cache: 172 139
Swap: 509 0 509


Sure, the buffers and the cached go up, but the used, even subtracting the buffers and cached, goes WAY up. This sounds like some memory leak to me. Anyone seen this? I don't seem to see it, at least not as bad, on single processor machines I have upgraded to 2.4.2.

 

BOFH

Senior member
Dec 31, 1999
456
0
0
you really should ask this on the linux-kernel mailing list as that is the proper place to ask about the kernel. you will get a much more authorative answer there.
 

Soybomb

Diamond Member
Jun 30, 2000
9,506
2
81
What BOFH said. My guess though is you've got a cron job going or a service starting or something that is altering it.
 

Zach

Diamond Member
Oct 11, 1999
3,400
1
81
Also, if you run Apache (and probably other stuff does this), it will start with only a few servers, and ass more idle ones if there's demand. Things like that will happen.
 

bubba

Golden Member
Oct 10, 1999
1,589
0
0

Interesting new data. I booted with an old 2.2.16 kernel I had on the machine and I don't see this problem. I left it running for a day (running all the same services, of course) and I only had 15-25 MB used!!! So it does seem to be 2.4.x...

 

perry

Diamond Member
Apr 7, 2000
4,018
1
0
I've noticed the same thing on a 2.2.18 single processor machine that I help admin. Here's a paragraph I found interesting from one of my Sair certification books:

"We have experimented with similar configurations and discovered that initially much of the large memory space goes unused since it is not required for programs or data access. However, as I/O continues over the days and weeks, memory slowly fills with hard disk information and subsequent 'infrequent hard disk' accesses are very fast indeed."

The similar configuration they were talking about is a machine with lots of memory, in the 1 - 2 GB range. But I imagine that you are probably seeing something similar. Dunno why it is more noticeable on the smp kernel though. Again, best bet is the kernel mailing list.
 

bubba

Golden Member
Oct 10, 1999
1,589
0
0

Perry-

What you are referring to is memory that would be labelled as "buffers" or "cached" in the 'free' listing. Linux, and any good OS, will dynamically cache I/O data in unused memory, but release it when it is requested by a process.

 

Soybomb

Diamond Member
Jun 30, 2000
9,506
2
81
Have you stopped all cron processes and the like for this and unplugge d the network card so its not being used by any means?
 

bubba

Golden Member
Oct 10, 1999
1,589
0
0

Doesn't matter. I ran the same test with the same software/hardware/services/cronjobs/etc, but only switched to the 2.2.16 kernel and this did not happen, so I think I have isolated it to the kernel/modules.
 

bubba

Golden Member
Oct 10, 1999
1,589
0
0

I THINK I FOUND THE ANSWER!!! :D

I noticed that after an 'updatedb' my mem-cached-buffers went up by 160MB! then I found this on a dejanews search:

"This is also why so much memory seems to be "used" after slocate indexes
your disk contents, under kernel 2.4. The memory looks as though
it's used by applications, but is actually held by the dentry and inode
caches, and is readily freed. You don't notice this in kernel 2.2 since
these slab caches are limited."

This sound believable to others?