Clamd memory usage

I noticed my clamd.virtualmin process (list of processes in webmin) takes about 162 MB of memory. The option to preload modules for virtualmin is turned off. What can be the reason that it uses this much of memory?

Well, that’s not technically a Virtualmin module… that’s the ClamAV daemon. And it does indeed use a lot of memory :slight_smile:

If you don’t wish to use the Clam daemon, you can switch that off and have it call clam each time an email comes in by going into Email Messages -> Spam and Virus Scanning, and switch Virus scanning program to “Standalone Scanner”.

Remember that even the command line ClamAV does use a lot of memory though, and if you anticipate a lot of incoming email, you could see a lot of memory usage, especially when multiple emails arrive at the same time.

So if you still find it using too much memory, you may want to consider disabling virus scanning altogether, allowing that to occur on the client side of things. Or, some folks prefer to host their email at places like Google Apps, allowing them to handle the mail processing.


Okay, what I understand is that without turning off virus filtering I can not reduce the memory load much. Probably when I choose to use the standalone scanner instead the memory usage might be the same but the speed might decrease.

In that case it might be best to leave it the way it is.

Yeah, unfortunately, ClamAV really does use a lot of memory.

Now, if you happen to have another server available, you can always run it remotely. However, other than that, if you’re low on RAM, you may want to consider disabling virus filtering.


Another thought about this: Ever since I turned on blacklisting (via Spamhaus Zen) and greylisting on my previous mail server, nearly no viruses at all made it through anymore, despite I had no virus filter. (It was a low-traffic server though, so not fully representative).

Viruses are, as I see it, distributed mostly through the same means as spam. And anti-spam measures will also be quite effective against viruses.

Which means, explicit virus filtering at mail server level is probably - I may be wrong there, but that’s my impression - not as important anymore as it was some time ago.

The latest ClamAV released a few weeks ago supposedly uses a new engine and specifically addressed the memory usage. Unfortunately the Virtualmin people have not gotten around to updating it in their packages and who knows when that will happen.

I think it is possible to update ClamAV yourself from source but I am not sure. Found one post where the Virtualmin guys did not recommend it because they said they had to do some customizations. YMMV.