Bug 56996 - slocate leaks memory
slocate leaks memory
Product: Red Hat Linux
Classification: Retired
Component: slocate (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2001-12-02 12:04 EST by Steve Snyder
Modified: 2014-03-16 22:24 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-02 12:28:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Steve Snyder 2001-12-02 12:04:42 EST
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:

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

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.:

renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e

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 12:26:26 EST
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 01:27:24 EST
This is normal; the machine is swapping older unused programs out so it can use
the memory for cache.

Note You need to log in before you can comment on or make changes to this bug.