Bug 59808

Summary: Huge memory usage; doesn't free any: system crashes.
Product: [Retired] Red Hat Linux Reporter: Need Real Name <orozco>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: alan, thuard
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-08 01:23:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2002-02-13 15:36:46 UTC
Description of Problem:
I updated from RH 7.0 to 7.2 and then upgraded to kernel 2.4.9-21. Xfree86 was
updated to 4.1.0-15 (all of this the latest available from RH). I have an
applications server with PIII (i686), 768 MB RAM and 2.5 GB swap. 

System keeps on using memory and not free any at all. Just in a few minutes, the
system goes from using 190 MB after a fresh boot to 750 MB (as reported from
'cat /proc/meminfo'). Eventually, uses all RAM and start using swap (amazing!)
then, X server freezes to death. I have to power off.

Monitoring the system with 'top' does not show excessive usage of memory or CPU
by any of the applications running.

This was not notices in previous 2.2 kernel.


Version-Release number of selected component (if applicable):
kernel 2.4.9-21


How Reproducible:
Always

Steps to Reproduce:
1.Just power on the box 
2. Start X server and some applications
3. Let it run for a few days; it'll eat up all your memory. Eventually, system
freezes to death. Unresponsive, need to power off.

Actual Results:
Server freezes after consuming all memory. I have to power off.


Expected Results:
A server should be up and running with no interruptions. Applications should
free unused memory.

Additional Information:
Similar bugs have been reported (e.g. bug # 52208, 53224, 55814, 59346) assuming
bugs with Nautilus, Gnome, GCC, etc. I see this problem regardless the
environment or platform (detected in the server described above, also in IBM
thinkpad PII 64 MB RAM, AMD-K6 128 MB, Dell laptop 128 MB RAM). I see that some
people is having the same problem regardless applications ran, Desktop/Window
manager environment, architecture, etc.

Any problem with the way the new kernel handles cache and memory pages?
Suggestions?

Thanks.

Comment 1 Arjan van de Ven 2002-02-19 11:12:38 UTC
There's a minor issue which basically means that the kernel sometimes is eager
to swap, and then also later is not too happy to give the swap back.
But that shouldn't trigger with 700Mb or more of ram....

It is normal that the kernel caches disk data for speed, so don't expect "free"
to be huge; "Cached" should be huge....

Comment 2 Need Real Name 2002-03-04 18:36:50 UTC
One thing is being eager to swap. The question is that the system eats almost
all memory before that. Output from my /proc/meminfom after one week of usage:

        total:    used:    free:  shared: buffers:  cached:
Mem:  789172224 763330560 25841664   585728 176377856 417247232
Swap: 2690293760   147456 2690146304
MemTotal:       770676 kB
MemFree:         25236 kB
MemShared:         572 kB
Buffers:        172244 kB
Cached:         407324 kB
SwapCached:        144 kB
Active:         321884 kB
Inact_dirty:    175560 kB
Inact_clean:     82840 kB
Inact_target:   196608 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       770676 kB
LowFree:         25236 kB
SwapTotal:     2627240 kB
SwapFree:      2627096 kB

System starts to noticeably freeze slowly. No abnormally huge CPU or mem usage
by any running application/daemon server as reported by 'top'. What is using the
memory and not freeing it? Any clue? Thanks.

Comment 3 josip 2002-03-30 15:14:50 UTC
We see similar problems on our machines, ranging from single PII/400 with 384MB
RAM to dual PIII/800 with 1024MB to PIV/1700 with 2048MB.  Incorrect 'free'
results interfere with our job scheduling because the machine(s) can appear to
have insufficient free RAM (+/- buffers/cache).  Sometimes, running a program
which requests and modifies as much memory as it can restores the 'free' numbers
to normal without reboot, but this does not always work.

In a couple of instances, it appeared that the system got into a memory starved
state and started killing processes at random, eventually crashing.

This bug was introduced in 2.4 series of kernels up to and including 2.4.9-31. 
I've even tried 2.4.19-pre4 and observed the same 'free' problem.

Correct /proc/meminfo and 'free' numbers are essential for stable operation, or
else GIGO behavior results.

Comment 4 Need Real Name 2002-04-14 07:06:35 UTC
I think I am having the same problem.  I am running Redhat 7.1/KDE on a
Dell Inspiron 8100 with 512 MB of memory.  I find that when I log into
my system, the allocated memory grows steadily (usually) with time.
When I start, the approximately 100 MB of memory is allocated, but
typically after a day or two, all of my memory has been allocated...
even if I have NO windows or applications running!  If I log out and
restart X, memory allocation doesn't change.  The only way I can get
the memory allocation back to a reasonable level is to reboot my machine.

At least one time, after rebooting my machine and logging in, my memory
allocation jumped from about 100 MB to about 300 MB (while my disk drive
was "grinding away").  I didn't do *anything*!  I think I had one or
two text editors open, that's it.

I was reading some messages about a similar problem on a Yahoo message
board (for linux users on Dell computers) from people running KDE under
Redhat 7.1 having the same sort of problem.  A few people thought that
the problem was with a memory leak from the ethernet card; we all might
be using the same internal ethernet card provided by Dell.  OK, I'm not
too sure what I'm talking about at this point.  I am just a UNIX (Solaris)
user who has just started using Redhat.  I'm very happy with Redhat on
the laptop; however, the memory leak is very serious.

(By the way, I did install the kdelib***.rpm fixes provided on the 
Redhat "up2date" installation, which mention that they help to
fix a memory leak.  They just didn't fix mine.)


Comment 5 Alan Cox 2003-06-08 01:23:31 UTC
Should all be fixed in current errata if not re-open - thanks