On 2017-08-07 14:27, Per Jessen wrote:
Carlos E. R. wrote:
On 2017-08-07 08:39, Per Jessen wrote:
Carlos E. R. wrote:
Could the daemon be started "on demand", and be killed a minute after the last email goes through?
I googled, and it seems that yes, clamd uses a lot of memory for the databases, and it can not be swapped out. Data, not code. However, I still don't understand why it remains in RAM hours after the last email was processed.
Possibly due to mlock(). Memory can be locked in. Or maybe clamd touches all of the database regularly.
My google finds (re clamd) say that you can not swap out a portion of the databases, because you do not know what will come in a file to scan. That I can understand, while scanning everything should be loaded in ram. But when nothing has been scanned for many minutes?
A quick grep through the libclamav source shows no mlock() calls. Maybe clamav wanders through the memory every so often? (like my code from my other posting)
You could check to see what clamd does with an strace.
Maybe, for scientific interest. You can say that 500 MB is not that large a memory. Well, it is 1/16 of all the memory I have and it is frozen used all the time... I still have to look at systemd examples, I just need to find the right state of mind to do so ;-) -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)