Clamav-daemon taking too much of memory

Hi Friends,

I have a query. I tried enabling clamav-daemon service on my home desktop computer by typing

sudo systemctl enable clamav-daemon.service

After this I see the memory used as soon as I login (without any other apps running in foreground) it has become 1.5 GB. Prior to this it was around 400 MB. Screenshots pasted. I wanted to know if I can remove this service from start up and manually update the virus signatures by running running freshclam. If this can be done, how do I remove the service from system? thanks in advance.



$ sudo systemctl status clamav-daemon
[sudo] password for ganeshp:
● clamav-daemon.service - Clam AntiVirus userspace daemon
Loaded: loaded (/usr/lib/systemd/system/clamav-daemon.service; enabled; ve>
Active: active (running) since Tue 2021-06-15 15:46:04 IST; 10min ago
TriggeredBy: ● clamav-daemon.socket
Docs: man:clamd(8)
man:clamd.conf(5)
https://www.clamav.net/documents/
Main PID: 464 (clamd)
Tasks: 2 (limit: 9294)
Memory: 1.2G
CPU: 15.972s
CGroup: /system.slice/clamav-daemon.service
└─464 /usr/sbin/clamd --foreground=true

Jun 15 15:46:21 anuganeshdesktop-a34024iwl clamd[464]: Tue Jun 15 15:46:21 2021>
Jun 15 15:46:21 anuganeshdesktop-a34024iwl clamd[464]: Tue Jun 15 15:46:21 2021>
Jun 15 15:46:21 anuganeshdesktop-a34024iwl clamd[464]: Tue Jun 15 15:46:21 2021>
Jun 15 15:46:21 anuganeshdesktop-a34024iwl clamd[464]: Tue Jun 15 15:46:21 2021>
Jun 15 15:46:21 anuganeshdesktop-a34024iwl clamd[464]: Tue Jun 15 15:46:21 2021>

Regards
Ganesh

Normally just run:

sudo systemctl disable --now clamav-daemon.service

It quits and is disabled.

Btw… why you are running a virus scanner for windows viruses on linux? This scanner is mainly used on linux mail server to protect windows computers from malware. If you run wine and install various windows software from suspicious sites, yeah, then I can understand that…

1 Like

Hello @megavolt,

I tried the command as suggested by you and here is the output.

Removed /etc/systemd/system/sockets.target.wants/clamav-daemon.socket.
Removed /etc/systemd/system/multi-user.target.wants/clamav-daemon.service.
Warning: Stopping clamav-daemon.service, but it can still be activated by:
clamav-daemon.socket

sudo systemctl status clamav-daemon ○ clamav-daemon.service - Clam AntiVirus userspace daemon
Loaded: loaded (/usr/lib/systemd/system/clamav-daemon.service; disabled; v>
Active: inactive (dead) since Tue 2021-06-15 16:22:43 IST; 4min 26s ago
TriggeredBy: ● clamav-daemon.socket
Docs: man:clamd(8)
man:clamd.conf(5)
https://www.clamav.net/documents/
Process: 473 ExecStart=/usr/sbin/clamd --foreground=true (code=exited, stat>
Main PID: 473 (code=exited, status=0/SUCCESS)
CPU: 15.213s

Jun 15 16:07:12 anuganeshdesktop-a34024iwl clamd[473]: Tue Jun 15 16:07:12 2021>
Jun 15 16:07:12 anuganeshdesktop-a34024iwl clamd[473]: Tue Jun 15 16:07:12 2021>
Jun 15 16:17:12 anuganeshdesktop-a34024iwl clamd[473]: Tue Jun 15 16:17:12 2021>
Jun 15 16:22:41 anuganeshdesktop-a34024iwl systemd[1]: /usr/lib/systemd/system/>
Jun 15 16:22:41 anuganeshdesktop-a34024iwl systemd[1]: Stopping Clam AntiVirus >
Jun 15 16:22:43 anuganeshdesktop-a34024iwl clamd[473]: Tue Jun 15 16:22:43 2021>
Jun 15 16:22:43 anuganeshdesktop-a34024iwl clamd[473]: Tue Jun 15 16:22:43 2021>
Jun 15 16:22:43 anuganeshdesktop-a34024iwl systemd[1]: clamav-daemon.service:

shall I also disable clamav-daemon.socket in similar lines?

Since I have Manjaro and Windows 10 dual boot on my two home desktops, I chose to keep clamav on my computer. If it continues to be a resource hog, I will be happy to uninstall it. thank you.

Regards
Ganesh

Not needed. The socket is there so that a app, if you run any clamav gui etc. , it can activate it again instantly.

Regards :wink:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.