Bug 249085

Summary: memory leak in yum-updatesd
Product: Red Hat Enterprise Linux 5 Reporter: Kevin Krafthefer <krafthef>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.0CC: jhutar, k.georgiou, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0388 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 10:20:46 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
hourly memory check (ps) none

Description Kevin Krafthefer 2007-07-20 16:00:22 EDT
Description of problem:
yum-updatesd will does not free up memory after a yum update takes place

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


How reproducible:
alwasy

Steps to Reproduce:
1. cat /proc/meminfo
2. yum update -y
3. cat /proc/meminfo
  
Actual results:
yum-updatesd consumes more and more memory with each yum update performed

Expected results:
yum-updatesd releases memory

Additional info:
related to fedora bugs 
228994 
239937 
244591 
243861 
243186 
212507
Comment 1 RHEL Product and Program Management 2007-10-16 09:44:59 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 4 Jan Hutař 2008-02-22 06:01:06 EST
Hello,
I'm not able to reproduce this - no significant memory raise AFAIK :(

# rpm -Uvh --oldpackage /tmp/repo-GOLD/{systemtap,sysstat,vim-common,vim-
enhanced,vim-X11}-*   # just to get in some old packages which would need to 
update
# service yum-updatesd restart
# cat /proc/meminfo > before
# yum -y upgrade systemtap
# yum -y upgrade vim-X11
# yum -y upgrade sysstat
# cat /proc/meminfo > after
# diff -u before after

Diff on the last line says this for OLD packages:

--- OLD-before  2008-02-22 11:45:30.000000000 +0100
+++ OLD-after   2008-02-22 11:46:08.000000000 +0100
@@ -1,21 +1,21 @@
 MemTotal:      2065492 kB
-MemFree:        679852 kB
-Buffers:        184364 kB
-Cached:        1027180 kB
+MemFree:        678984 kB
+Buffers:        185184 kB
+Cached:        1026952 kB
 SwapCached:          0 kB
-Active:         653640 kB
-Inactive:       651356 kB
+Active:         653032 kB
+Inactive:       652560 kB
 HighTotal:     1169404 kB
-HighFree:        47968 kB
+HighFree:        47844 kB
 LowTotal:       896088 kB
-LowFree:        631884 kB
+LowFree:        631140 kB
 SwapTotal:     1835000 kB
 SwapFree:      1835000 kB
-Dirty:           11884 kB
+Dirty:           42312 kB
 Writeback:           0 kB
 AnonPages:       93420 kB
 Mapped:          34056 kB
-Slab:            68740 kB
+Slab:            68832 kB
 PageTables:       3428 kB
 NFS_Unstable:        0 kB
 Bounce:              0 kB

Adn this for NEW yum-* packages:

--- NEW-before  2008-02-22 12:27:09.000000000 +0100
+++ NEW-after   2008-02-22 12:28:00.000000000 +0100
@@ -1,26 +1,26 @@
 MemTotal:      2065492 kB
-MemFree:        674328 kB
-Buffers:        186864 kB
-Cached:        1027152 kB
+MemFree:        670856 kB
+Buffers:        187280 kB
+Cached:        1029884 kB
 SwapCached:          0 kB
-Active:         658456 kB
-Inactive:       651792 kB
+Active:         661376 kB
+Inactive:       652040 kB
 HighTotal:     1169404 kB
-HighFree:        37740 kB
+HighFree:        47040 kB
 LowTotal:       896088 kB
-LowFree:        636588 kB
+LowFree:        623816 kB
 SwapTotal:     1835000 kB
 SwapFree:      1835000 kB
-Dirty:           35900 kB
+Dirty:           37788 kB
 Writeback:           0 kB
-AnonPages:       96196 kB
+AnonPages:       96220 kB
 Mapped:          33620 kB
-Slab:            68656 kB
+Slab:            68868 kB
 PageTables:       3468 kB
 NFS_Unstable:        0 kB
 Bounce:              0 kB
 CommitLimit:   2867744 kB
-Committed_AS:   388984 kB
+Committed_AS:   388980 kB
 VmallocTotal:   114680 kB
 VmallocUsed:      5644 kB
 VmallocChunk:   108816 kB

Checking `grep Vm /proc/`pidof -x yum-updatesd`/status` shows exactly *no* 
differences.

Is here something more I can try?

Thanks in advance,
Jan
Comment 5 James Antill 2008-02-22 10:00:12 EST
 I assume the "yum update -y" instruction was a typo, or a holder for what
yum-updatesd would be doing.
 As running the update from the yum command line wouldn't affect yum-updatesd.

 Have yum-updatesd configured to apply updates, then start the service and wait
for it to check (lower the timeout to 5m or so, should be fine).
Comment 8 Stefan Orbilt 2008-04-01 10:58:02 EDT
I noticed only recently that yum-updatesd leaks memory like crazy. In 24 hours
it can leak 200-400 MB. I am running RHEL 5.1 with yum-updatesd-3.0.1-5.el5.
This is similar to this bug: https://bugzilla.redhat.com/show_bug.cgi?id=249894.
Could it have something to do with a recent kernel update or yum-rhn-plugin update?

Like James said "yum update -y" doesn´t affect this.
Comment 9 Stefan Orbilt 2008-04-07 07:30:51 EDT
Created attachment 301503 [details]
hourly memory check (ps)

Attached is the output log I have created by running "ps" hourly in a cron job.
As you can see yum-updatesd leaks about 10 MB per hour.

I have also made a cron job now that restarts yum-updatesd if...I mean when the
memory usage reaches 295 MB.
Comment 11 errata-xmlrpc 2008-05-21 10:20:46 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0388.html