Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory usage? #64

Closed
aznarepse opened this issue Aug 29, 2020 · 2 comments
Closed

Memory usage? #64

aznarepse opened this issue Aug 29, 2020 · 2 comments
Assignees
Labels

Comments

@aznarepse
Copy link

I am guessing the daemon needs considerable memory to hold the virus signatures but the container alpine-edge is using 1.3G RAM. Is this normal?

@mko-x
Copy link
Owner

mko-x commented Aug 29, 2020

ClamAV holds the search strings using the classic string (Boyer Moore) and regular expression (Aho Corasick) algorithms. Being algorithms from the 1970s they are extemely memory efficient.

The problem is the huge number of virus signatures. This leads to the algorithms' datastructures growing quite large.

You can't send those datastructures to swap, as there are no parts of the algorithms' datastructures accessed less often than other parts. If you do force pages of them to swap disk, then they'll be referenced moments later and just swap straight back in. (Technically we say "the random access of the datastructure forces the entire datastructure to be in the process's working set of memory".)

The datastructures are needed if you are scanning from the command line or scanning from a daemon.

You can't use just a portion of the virus signatures, as you don't get to choose which viruses you will be sent, and thus can't tell which signatures you will need.

From: https://unix.stackexchange.com/questions/114709/how-to-reduce-clamav-memory-usage

@mko-x mko-x added the question label Aug 29, 2020
@mko-x mko-x self-assigned this Aug 29, 2020
@mko-x
Copy link
Owner

mko-x commented Sep 3, 2020

This repo is only for making ClamAV work with docker.

Performance issues should be questioned to ClamAV or Alpine directly.

In general an increase of ram allocation on startup of the image is usual.

You could dive into memory consumption inside the image with top, Lime or Votality or other tools and report your results.

@mko-x mko-x closed this as completed Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants