Hello, I'm also seeing large memory usage of freshclam in Gentoo x86-64,
there is a memory graph here: http://imagebin.ca/view/V-BshuFl.html In the
graph you can see the big memory usage of freshclam around June and
subsequent OOM kill. Now it's happening again. For the moment I will keep
freshclam alive just in case someone needs some debug/dump/info, but if no
solution is found I will setup a weekly cron to restart freshclam. At this
moment is at >1.5 gigabyte and slowly growing:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+
COMMAND
14360 clamav    39  19 1532m 1.1g 5236 S    0 29.7  22:17.62
freshclam
14347 clamav    23   3  395m 266m 5388 S    0  6.7  49:49.39
clamd

Our config is:

# egrep '^[^#]' /etc/freshclam.conf
UpdateLogFile /var/log/clamav/freshclam.log
LogFileMaxSize 4M
LogTime yes
PidFile /var/run/clamav/freshclam.pid
DatabaseOwner clamav
AllowSupplementaryGroups yes
DNSDatabaseInfo current.cvd.clamav.net
DatabaseMirror db.es.clamav.net
DatabaseMirror database.clamav.net
ScriptedUpdates yes
Checks 48
NotifyClamd /etc/clamd.conf
SafeBrowsing yes

# clamconf -n
Checking configuration files in /etc

Config file: clamd.conf
-----------------------
LogFile = "/var/log/clamav/clamd.log"
LogTime = "yes"
PidFile = "/var/run/clamav/clamd.pid"
LocalSocket = "/var/run/clamav/clamd.sock"
User = "clamav"
AllowSupplementaryGroups = "yes"

Config file: freshclam.conf
---------------------------
LogFileMaxSize = "4194304"
LogTime = "yes"
PidFile = "/var/run/clamav/freshclam.pid"
AllowSupplementaryGroups = "yes"
UpdateLogFile = "/var/log/clamav/freshclam.log"
Checks = "48"
DatabaseMirror = "db.es.clamav.net", "database.clamav.net"
SafeBrowsing = "yes"

clamav-milter.conf not found

Software settings
-----------------
Version: 0.96.1
Optional features supported: MEMPOOL CLAMUKO AUTOIT_EA06 BZIP2 RAR JIT
Database directory: /var/lib/clamav
main.cvd: version 52, sigs: 704727, built on Mon Feb 15 15:54:51 2010
daily.cld: version 11525, sigs: 109522, built on Tue Aug 10 10:18:29 2010
safebrowsing.cld: version 22992, sigs: 725991, built on Tue Aug 10 11:45:41
2010
bytecode.cld: version 33, sigs: 8, built on Tue Aug 10 07:57:52 2010

Platform information
--------------------
uname: Linux 2.6.28-hardened-r9 #1 SMP Thu Feb 4 13:34:23 CET 2010 x86_64
OS: linux-gnu, ARCH: x86_64, CPU: x86_64
zlib version: 1.2.3 (1.2.3), compile flags: a9

Build information
-----------------
GNU C: 4.3.4 (4.3.4)
GNU C++: 4.3.4 (4.3.4)
CPPFLAGS:
CFLAGS: -O2 -march=athlon64 -pipe -ggdb -fno-strict-aliasing
CXXFLAGS: -O2 -march=athlon64 -pipe -ggdb
LDFLAGS: -Wl,-O1
Configure: '--prefix=/usr' '--build=x86_64-pc-linux-gnu'
'--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc'
'--localstatedir=/var/lib' '--libdir=/usr/lib64' '--enable-bzip2'
'--disable-ipv6' '--enable-clamdtop' '--disable-milter' '--with-iconv'
'--disable-experimental' '--enable-id-check' '--disable-zlib-vcheck'
'--with-dbdir=/var/lib/clamav' 'build_alias=x86_64-pc-linux-gnu'
'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-O2 -march=athlon64 -pipe -ggdb'
'LDFLAGS=-Wl,-O1'

As I have seen in the archives one solution could be to disable
SafeBrowsing, but in this case it's of valuable use to us. I have setup a
second freshclam in daemon mode and different directory without SafeBrowsing
to test for anomalies, it has just completed the first initial setup and
it's using ~51Mb :

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+
COMMAND
12356 clamav    20   0 51608 7140 5240 S    0  0.2   0:06.35
freshclam

The contents of the directories now are:

/var/lib/clamav:
total 65M
-rw-r--r-- 1 clamav clamav  82K Aug 10 08:33 bytecode.cld
-rw-r--r-- 1 clamav clamav 6.4M Aug 10 10:35 daily.cld
-rw-r--r-- 1 clamav clamav  22M Jul 26 14:38 main.cvd
-rw------- 1 clamav clamav  208 Aug 10 13:36 mirrors.dat
-rw-r--r-- 1 clamav clamav  36M Aug 10 13:06 safebrowsing.cld

/var/lib/clamav-debug:
total 25M
-rw-r--r-- 1 clamav clamav  24K Aug 10 13:46 bytecode.cvd
-rw-r--r-- 1 clamav clamav 2.5M Aug 10 13:46 daily.cvd
-rw-r--r-- 1 clamav clamav  22M Aug 10 13:45 main.cvd
-rw------- 1 clamav clamav   52 Aug 10 13:46 mirrors.dat

Will see how it evolves.

-- 
Jorge Nerín
<jne...@gmail.com>
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to