Bug 56996

Summary: slocate leaks memory
Product: [Retired] Red Hat Linux Reporter: Steve Snyder <swsnyder>
Component: slocateAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: rvokal
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: 2001-12-02 17:28:20 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 Steve Snyder 2001-12-02 17:04:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011121

Description of problem:
Running the /etc/cron.daily/slocate job increases the amount of swap used.
 Each run will increase the swap (as reported by free) by 150KB - 850KB,
apparently depending on compiler flags.

Version-Release number of selected component (if applicable):
From slocate-2.6-1 RPM

How reproducible:
Always

Steps to Reproduce:
1.Run "free", noting the amount of swap space used
2.Run: /etc/cron.daily/slocate
3.Run "free" again, noting the increase in swap space used.
4.Repeat steps 1 through 3 until you're tired of seeing your available swap
reduced.
	

Actual Results:  Use of swap space increased after each run

Expected Results:  Repeated increased in swap use should not be seen.



Additional info:

1. I can understand why increased swap usage might be seen on the first
run; might need to free some RAM for slocate itself to run.  The repeated
reduction in available swap, though, should not be seen.  Note that this
box has 512MB of RAM installed and is not memory contrained.

2. For the record, my /etc/cron.daily/slocate script is the stock script
from RPM with /var/spool/squid added to the ignore list, i.e.:

#!/bin/sh
renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e
"/tmp,/var/tmp,/usr/tmp,/afs,/net/var/spool/squid"

3. I originally ran with a binary slocate RPM that I built myself (from
Enigma's slocate-2.6-1.src.rpm) using these compiler switches: "-march=i686
-O2 -fomit-frame-pointer".  After observing a ~850KB swap loss on each run
I thought it might be my build, so I replaced the binary RPM with the one
(same version) built by RedHat on my Enigma distribution CD.  Now the swap
loss is ~150KB per run.

4. This loss of swap is observed on 2 i686 Enigma boxes, both with all
RedHat-released Enigma updates installed.  I wouldn't swear to it, but it
seems that the machine with more files to catalog loses a little more swap
than the machine with fewer files.

Comment 1 Steve Snyder 2001-12-02 17:26:26 UTC
The inevitable typo fixes:

In entering my slocate.cron script into the bug report I mistakenly omitted a
comma.  The text "/net/var/spool/squid" should be "/net,/var/spool/squid".

Sorry for the inconvenience.



Comment 2 Bill Nottingham 2002-01-25 06:27:24 UTC
This is normal; the machine is swapping older unused programs out so it can use
the memory for cache.