clamav-users August 2007 archive
Main Archive Page > Month Archives  > clamav-users archives
clamav-users: Re: [Clamav-users] memory leak in clamd (0.91.1)?

Re: [Clamav-users] memory leak in clamd (0.91.1)? - Temporary partial files

From: Tomasz Chmielewski <mangoo_at_nospam>
Date: Tue Aug 14 2007 - 13:38:09 GMT
To: ClamAV users ML <clamav-users@lists.clamav.net>


Eric Kruse schrieb: >> Does clamd (0.91.1) have a memory leak of some sort?
> >
> > After it's started, it takes just about 40-50 MB:
> >
> > clamav 13602 48.0 8.4 47932 45128 ? Ds 10:38
> 0:01
> > clamd
> > -c /etc/clamd.conf
> >
> >
> > After some time, the memory usage goes to about 100 MB,
> machine
> > begins
> > to swap more and more:
>
> We had a similar problem, found that the temporary files from
> scanning
> partial mime messages were not being cleaned up. And were taking
> up
> large amounts of disk space
>
> I wrote a one liner put in cron.daily to clean these files if
> older than
> 1 day just to be safe.
>
> Was surprised to see that deleting them also freed up memory
> used by
> clamd, so maybe they weren't deleted in first place because
> clamd is
> still holding onto them.
>
> Hope this helps:
>
> #!/bin/bash
> find /var/spool/qmailscan/clamav-partial/* -mtime +1 -exec rm {}
> ';'
# grep tmp /etc/clamd.conf TemporaryDirectory /var/lib/clamav/tmp # ls -l /var/lib/clamav/tmp total 0 # lsof -n|grep clamd clamd 19407 clamav cwd DIR 8,5 4096 2 / clamd 19407 clamav rtd DIR 8,5 4096 2 / clamd 19407 clamav txt REG 8,5 69528 33959 /usr/sbin/clamd clamd 19407 clamav mem REG 0,0 0 [heap] (stat: No such file or directory) clamd 19407 clamav mem REG 8,5 9488 640154 /usr/lib/gconv/UTF-16.so clamd 19407 clamav mem REG 8,5 5384 640100 /usr/lib/gconv/ISO8859-1.so clamd 19407 clamav mem REG 8,5 26052 640182 /usr/lib/gconv/gconv-modules.cache clamd 19407 clamav mem REG 8,5 46612 612138 /lib/libnss_nisplus-2.6.1.so clamd 19407 clamav mem REG 8,5 38420 612133 /lib/libnss_files-2.6.1.so clamd 19407 clamav mem REG 8,5 1298800 612003 /lib/i686/libc-2.6.1.so clamd 19407 clamav mem REG 8,5 107818 612060 /lib/i686/libpthread-2.6.1.so clamd 19407 clamav mem REG 8,5 79620 612089 /lib/libnsl-2.6.1.so clamd 19407 clamav mem REG 8,5 236900 642039 /usr/lib/libgmp.so.3.4.1 clamd 19407 clamav mem REG 8,5 66336 638993 /usr/lib/libbz2.so.1.0.0 clamd 19407 clamav mem REG 8,5 73576 611298 /lib/libz.so.1.2.3 clamd 19407 clamav mem REG 8,5 612980 639370 /usr/lib/libclamav.so.2.0.7 clamd 19407 clamav mem REG 8,5 565185 612074 /lib/ld-2.6.1.so clamd 19407 clamav 0u CHR 1,3 871 /dev/null clamd 19407 clamav 1u CHR 1,3 871 /dev/null clamd 19407 clamav 2u CHR 1,3 871 /dev/null clamd 19407 clamav 3w REG 8,5 67027 34477 /var/log/clamav/clamd.log clamd 19407 clamav 4u unix 0xd49c6380 105750 /var/lib/clamav/clamd.socket

Nope, it must be something else, no temporary files here. -- Tomasz Chmielewski http://wpkg.org _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html