Articles in this section

Enabling ClamAV in Plesk Email Security fails: Cannot allocate memory

Plesk for Linux kb: technical ext: pes

Applicable to:

  • Plesk for Linux

Symptoms

  • Enabling ClamAV in the Plesk Email Security extension fails:

    PLESK_ERROR: Execution filemng has failed with exit code 1, stdout: , stderr: Job for clamd@scan.service failed because the control process exited with error code. See "systemctl status clamd@scan.service" and "journalctl -xe" for details.

  • Manually enabling the service clamd in the server's console also fails:

    # systemctl status clamd@scan.service
    * clamd@scan.service - clamd scanner (scan) daemon
    Loaded: loaded (/usr/lib/systemd/system/clamd@.service; enabled; vendor preset: disabled)
    Active: activating (start) 
    ...
    clamd[17834]: daemonize() failed: Cannot allocate memory
    clamd[17834]: Socket file removed.

  • Clamd process has a high CPU usage:

    # ps awufx | grep clamd | grep -v grep
    amavis 1804892 96.3 24.7 1117096 968048 ? Rs 17:19 0:10 /usr/sbin/clamd -c /etc/clamd.d/amavisd.conf

  • The following error is shown multiple times on the /var/log/maillog file:

    # egrep "Cannot allocate memory" /var/log/maillog | wc -l
    3114

Cause

There is not enough RAM memory to initialize the service. The server should have at least 4 GB of overall RAM and 2 GB free RAM.

Resolution

Allocate more RAM to the server either on your own or by contacting the administrator/provider of the server.

Additional Information

The clamav-milter service, which is a part of Plesk Email Security extension, is stopped by default. The service is managed by Clam Antivirus and is started automatically on a request.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.