Red Hat Bugzilla – Bug 56996
slocate leaks memory
Last modified: 2014-03-16 22:24:36 EDT
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
Steps to Reproduce:
1.Run "free", noting the amount of swap space used
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.
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.
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.
This is normal; the machine is swapping older unused programs out so it can use
the memory for cache.