Major memory leak with Debian & Bios RU/RV

OS / Drivers / BIOS
Post Reply
MayDay
Posts: 5
Joined: Fri Aug 06, 2004 12:39 am

Major memory leak with Debian & Bios RU/RV

Post by MayDay »

I have had my Dual 466Mhz for a long time, once it was even a Dual 333@500 until i got two 466Mhz for free. It ran heavenly under Win2k and WinXP up until i changed it for a P4 1.6Ghz.

For the last year i started running Linux on it, Debian stable, unstable, testing. kernel version 2.2, 2.4 and 2.6. All kinds of different combinations.
At first it was just to test and have fun. But since 5 months ago i had to use it for more serious stuff and thats about the time i started to notice the serious memory leak.

I always thought it was something i compiled wrong or forgot. I tried alot of combinations but the memory leak remains. So two weeks ago the harddrive crashed because of the heat. Now i JUST reinstalled and are running Debian Sarge with kernel version 2.4.26-1-386 which is not a custom compiled kernel, but then again i know I cant compile a kernel which removes the memory leak so this single cpu kernel is fine until i find and remove the leak.

I have been running bios version RU for a long time, just patched to RV yesterday, the APIC Errors i used to get are gone i think, i actually thought that was the problem until i read about what it was on the forum, i still tried to disable it in the bios to see if it made a difference, it diden't.

Following are 2 TOP dumps, first is RIGHT after boot, the second is a little later, only SSHD and apt-get was used in the meantime:

Code: Select all

top - 01:08:43 up 18 min,  1 user,  load average: 0.00, 0.01, 0.00
Tasks:  25 total,   1 running,  24 sleeping,   0 stopped,   0 zombie
Cpu(s):   0.4% user,   0.0% system,   0.0% nice,  99.6% idle
Mem:    516364k total,    50080k used,   466284k free,     4732k buffers
Swap:   497972k total,        0k used,   497972k free,    35180k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
  740 root      13   0  1908 1904 1664 S  0.0  0.4   0:00.06 sshd
  708 Debian-e   9   0  1468 1464 1248 S  0.0  0.3   0:00.00 exim4
  721 root       9   0  1440 1440 1312 S  0.0  0.3   0:00.01 sshd
  743 root      18   0  1404 1404 1120 S  0.0  0.3   0:00.02 bash
  677 root       9   0  1344 1344  476 S  0.0  0.3   0:00.25 klogd
  745 root      19   0  1036 1036  844 R  0.4  0.2   0:00.02 top
  728 root       9   0   712  712  608 S  0.0  0.1   0:00.01 cron
  585 root       9   0   664  664  548 S  0.0  0.1   0:00.00 dhclient
  725 daemon     9   0   624  624  548 S  0.0  0.1   0:00.00 atd
  674 root       9   0   612  612  520 S  0.0  0.1   0:00.04 syslogd
  714 root       9   0   520  520  464 S  0.0  0.1   0:00.01 inetd
    1 root      10   0   508  504  456 S  0.0  0.1   0:00.15 init
  734 root       9   0   472  472  420 S  0.0  0.1   0:00.01 getty
  735 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  736 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  737 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  738 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  739 root      10   0   472  472  420 S  0.0  0.1   0:00.01 getty
    2 root       8   0     0    0    0 S  0.0  0.0   0:00.00 keventd
    3 root      19  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd_CPU0
    4 root       9   0     0    0    0 S  0.0  0.0   0:00.00 kswapd
    5 root       9   0     0    0    0 S  0.0  0.0   0:00.00 bdflush
    6 root       9   0     0    0    0 S  0.0  0.0   0:00.00 kupdated
  105 root       9   0     0    0    0 S  0.0  0.0   0:00.03 kjournald
  370 root       9   0     0    0    0 S  0.0  0.0   0:00.00 khubd

Code: Select all

top - 09:00:34 up  9:10,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  25 total,   1 running,  24 sleeping,   0 stopped,   0 zombie
Cpu(s):   0.0% user,   0.0% system,   0.0% nice, 100.0% idle
Mem:    516364k total,   269728k used,   246636k free,    15204k buffers
Swap:   497972k total,        0k used,   497972k free,   233652k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
  1458 root      12   0  1908 1904 1664 S  0.0  0.4   0:00.04 sshd
  705 Debian-e   9   0  1468 1464 1248 S  0.0  0.3   0:00.01 exim4
  1005 root       9   0  1440 1440 1312 S  0.0  0.3   0:00.02 sshd
  1461 root      14   0  1404 1404 1120 S  0.0  0.3   0:00.02 bash
  674 root       9   0  1344 1344  476 S  0.0  0.3   0:00.28 klogd
  1463 root      19   0  1036 1036  844 R  0.0  0.2   0:00.06 top
  725 root       9   0   712  712  608 S  0.0  0.1   0:00.00 cron
  585 root       9   0   664  664  548 S  0.0  0.1   0:00.02 dhclient
  722 daemon     9   0   624  624  548 S  0.0  0.1   0:00.00 atd
  671 root       9   0   612  612  520 S  0.0  0.1   0:00.04 syslogd
  711 root       9   0   520  520  464 S  0.0  0.1   0:00.00 inetd
    1 root       7   0   508  504  456 S  0.0  0.1   0:00.20 init
  731 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  732 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  733 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  734 root       9   0   472  472  420 S  0.0  0.1   0:00.01 getty
  735 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
  736 root       9   0   472  472  420 S  0.0  0.1   0:00.00 getty
    2 root       8   0     0    0    0 S  0.0  0.0   0:00.00 keventd
    3 root      19  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd_CPU0
    4 root       9   0     0    0    0 S  0.0  0.0   0:00.00 kswapd
    5 root       9   0     0    0    0 S  0.0  0.0   0:00.00 bdflush
    6 root       9   0     0    0    0 S  0.0  0.0   0:00.00 kupdated
  105 root       9   0     0    0    0 S  0.0  0.0   0:00.49 kjournald
  368 root       9   0     0    0    0 S  0.0  0.0   0:00.00 khubd
50Mb after boot, 270Mb 9 hours later by doing nothing...

Im all out of ideas now, i dont understand why i am the ONLY one with this problem, and why its only under linux, not windows.

I actually thought about switching to FreeBSD, but i know nothing about it and i LOVE debian, apt truely has super cow powers :D

If anyone can help me got damnit i will name something after you! :D

Looking forward to replies with much anticipation...

MayDay
Last edited by MayDay on Thu Sep 09, 2004 11:16 pm, edited 2 times in total.
MayDay
Posts: 5
Joined: Fri Aug 06, 2004 12:39 am

Post by MayDay »

BTW. I know from the last 5 months of looking at memory graphs that it goes all the way up to 500'ish Memory use and then i have seen the graph suddenly DUMP to 90-120Mb usage in the middle of the night.

And thats with programs running on it, where 80Mb is what it used after boot with that setup.
MayDay
Posts: 5
Joined: Fri Aug 06, 2004 12:39 am

Post by MayDay »

Okay... i was being a noob... I can't believe i never knew this in all this time i have been running linux :D

http://info-x.co.uk/docview.asp?id=117
purrkur
Linux Guru
Posts: 687
Joined: Fri Dec 12, 2003 5:57 pm
Location: Sweden
Contact:

Post by purrkur »

Damn! I was looking forward to having something named after me!!

:D

Let me tell you that this issue is something that gets ALL Linux newbies. I don't know how many times I have had to explain how Linux divides up memory resources into apps/cache/buffer.

Of course you should never really trust "top" unless you really know how it works inside and out (and you run it as root). "Free" is the tool to use to check memory resource, however, there are two hints that could have pointed you in the right direction, even without the use of "free":

1. A memory leak is always a result of an application running wild, which means that you can see the process growing. You would clearly see a single application using up tremendous amount of memory in "top", which you don't in your "top" outputs above.

2. If a process starts taking up memory, and if memory eventually runs out then the kernel will start swapping to disk. If your swap numbers are close to nothing then that means that the computer really isn't out of memory.
2x533MHz@544MHz, 2.0V
640MB PC100 memory
Realtek RTL-8139 NIC
Maxtor 6Y080L0 80GB hdd
Debian Linux stable with 2.4.8 kernel
MayDay
Posts: 5
Joined: Fri Aug 06, 2004 12:39 am

Post by MayDay »

Yeah i did think of both, but that just made the "memory leak" even more wierd. Im really happy now i found this out.

Ill have to rewrite my mrtg memory display so it uses the free tool :wink:
MayDay
Posts: 5
Joined: Fri Aug 06, 2004 12:39 am

Post by MayDay »

Okay while i did learn something very importent im now posetive that there was a problem "before".

After i found out about the free command i notice that was what i was using for my mrtg.

Code: Select all

#!/bin/sh

USED=`free -b|grep cache:|cut -d ":" -f2|cut -c1-11`
FREE=`free -b|grep cache:|cut -d ":" -f2|cut -c12-22`

echo $USED
echo $FREE


This is live: http://pp.lir.dk:8080/mrtg/ppx.memory.html

Im using the server extensively while im setting it up and im 1 program away "eggdrop" from having the same load as before and it dosent show at all.

Im thinking its the "acpi?" fixes in the last bios update or i got lucky with the kernel i compiled.

Anyways, im happy :D
purrkur
Linux Guru
Posts: 687
Joined: Fri Dec 12, 2003 5:57 pm
Location: Sweden
Contact:

Post by purrkur »

Hej Mayday,

I am not sure what you mean by all this since you only show what you were running but not the results of it. Anyhow, FWIW, I am running Debian unstable on my BP6 with the latest BIOS and with ACPI activated without any issues.

The only leak that I have heard of recently in the 2.6 kernels is in 2.6.8.1 but that leak is only realised if you are burning music CDs.
2x533MHz@544MHz, 2.0V
640MB PC100 memory
Realtek RTL-8139 NIC
Maxtor 6Y080L0 80GB hdd
Debian Linux stable with 2.4.8 kernel
davd_bob
Confused
Posts: 1043
Joined: Fri Feb 13, 2004 2:30 am
Location: Houston, TX

Post by davd_bob »

My wife says I have a memory leak.
I think it has something to do with a cast iron skillit and a growing bald spot on the back of my head.
There are *almost* no bad BP6s. There are mostly bad caps.

No BP6s remaining
Athlon 2800
Sempron 2000
ViaCPU laptop with Vista.(Works great after bumping ram to 2Gig)
P-III 850@100
PaulW
Posts: 7
Joined: Tue Jun 03, 2003 1:18 pm
Location: Cheshire, England
Contact:

Post by PaulW »

from reading up on this myself, 2.4 SMP kernel also has a pretty nasty memory leak in debian, I've noticed this myself when testing, SMP kernel (aswell as poor hardware support compared to non-SMP kernel) was having fun with memory useage, so I switched back to the non-SMP 2.4 kernel and all is fine (seens 2.6 wont work - see other topic i did)

its all fun tho :lol:
BP6 Dual Cel 500 @ 2v (Debian Sarge 3.1) - Web/Mail/Proxy Server
Athlon 2600+XPM @ 3GHz (Phase & Water cooled)
Athlon 1300 (bleh)
Dell Inspiron 110L (uni bleh)
HP NC4000 (portable bleh)
purrkur
Linux Guru
Posts: 687
Joined: Fri Dec 12, 2003 5:57 pm
Location: Sweden
Contact:

Post by purrkur »

PaulW wrote:from reading up on this myself, 2.4 SMP kernel also has a pretty nasty memory leak in debian, I've noticed this myself when testing, SMP kernel (aswell as poor hardware support compared to non-SMP kernel) was having fun with memory useage, so I switched back to the non-SMP 2.4 kernel and all is fine (seens 2.6 wont work - see other topic i did)

its all fun tho :lol:
Yeah, you seem to have quite a lot of issues! Timing issues, memory leaks, but I can't remember seeing such issues being discussed on the debian dev channels or Linux kernel mailing lists nor have I seen such issues myself and I have been running Debian Linux for years. It is strange that anybody is using Linux at all with these ultra-serious problems at hand.

I really don't have the time for this but I will play along. Please give me details on exactly what you did to come to the conclusion that the kernel leaks. Tell me what commands you used and how you traced what was going on to the kernel.
2x533MHz@544MHz, 2.0V
640MB PC100 memory
Realtek RTL-8139 NIC
Maxtor 6Y080L0 80GB hdd
Debian Linux stable with 2.4.8 kernel
Post Reply