I retried to apply the patch. As I thought, I didn't apply it well and there were no free() at all. So, it was fast, but after several reload, my memory was down. I applied it correctly and unhappily, it doesn't really change the time taken for a reload. Maybe the solution would be in memory usage : how could I do to make clamd use more RAM than it does now ?
2010/6/10 Török Edwin <[email protected]> > On 2010-06-10 22:29, Vivien Raoul wrote: > > 2010/6/10 Török Edwin <[email protected]> > > > >> On 2010-06-10 21:29, Vivien Raoul wrote: > >>> Actually, I'm not sure of what I did ; I couldn't apply the patch with > >>> "patch", and I made the changes manually ; but it seems that all the > >> free() > >>> are in the #if 0 block. > >>> What is exactly your patch supposed to do ? > >> > >> If ClamAV is built with memory pool support (which by default it is on > >> Linux), then there is no point in trying to free each individual node > >> from the tree (which can be hundreds of thousands). > >> Instead they will be all freed by the mpool_destroy(). > >> > >> My guess is that the individual frees need to bring back some data from > >> the swap, before actually freeing it. And this is done for each node, so > >> it takes a while if you have limited memory, and a slow disk. > >> > > > > So if I understood well, your modification implies no free at all ? > > There is a single "free" that frees all the database at once, instead of > trying to free each individual piece. > > > > >> > >> How fast is "really fast" though? > >> > > > > The force-reload took about 3 to 8 minutes, now it takes less than 1 min > > (between 37 and 53s). > > OK, please open a bug then so that we may eventually include the patch > into a release. > > I tried it several times, and I did not see memory leeks (the "free" > command > > shows me normal things). > > > > Regards, > > Vivien > > > >> > >> Best regards, > >> --Edwin > >> _______________________________________________ > >> Help us build a comprehensive ClamAV guide: visit > http://wiki.clamav.net > >> http://www.clamav.net/support/ml > >> > > _______________________________________________ > > Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net > > http://www.clamav.net/support/ml > > _______________________________________________ > Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net > http://www.clamav.net/support/ml > _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://www.clamav.net/support/ml
