On Tue, May 02, 2006 at 05:40:56PM -0400, John Kelly wrote:
> >> At startup, clamav-milter memory usage is approx. 11m resident and 30m
> >> virtual. But when freshclam loads a new database, memory jumps to 20m
> >> resident and 40m virtual.
> 
> > I am seeing the same behaviour on clamd cross-compiled for ARM/Xscale. I
> > think this is caused by a great deal of memory fragmentation due to
> > allocating lots of small chunks (down to 1 byte).
> 
> Clamd?  Or did you mean clamav-milter?
> 
> Here, using clamav-milter --external and clamd seems to eliminate the
> memory increase.  So the problem must be something in clamav-milter.
> 
> For efficiency, I like running clamav-milter with its internal scan
> using libclamav.  Maybe I could fix the memory problem if I had the
> time.  Unfortunately, I don't.

Both clamd and clamav-milter should use the same library functions to
parse/load the database, so I suppose both are affected.

Basically, preventing a database _reload_ solved my problem, ie. I made
freshclam notify clamd with command "QUIT" to restart instead of
"RELOAD" to reload the database, which would result in freeing the used 
memory and fragmenting the heap, and  increasing the heap size on reload
afterwards.

I also used the option "SelfCheck 0" to disable the automatic database
reload after some time.

Peter



--
Peter Vollmer
Software Engineer
Innominate Security Technologies AG  /device attached security/
http://www.innominate.com>
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to