# clamd's huge memory requirements!

## richard.scott

Hi,

I have a server running amavis and clamd etc. Over the past 3 weeks my memory footprint for clamd has been huge!

```
top - 14:03:00 up  3:48,  1 user,  load average: 1.78, 1.76, 1.58

Tasks: 108 total,   1 running, 107 sleeping,   0 stopped,   0 zombie

Cpu(s):  0.6%us,  0.4%sy,  0.0%ni, 79.1%id, 19.8%wa,  0.0%hi,  0.0%si,  0.0%st

Mem:    553176k total,   546528k used,     6648k free,      916k buffers

Swap:   262136k total,   176160k used,    85976k free,   165516k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

 4232 amavis    21   3  311m 223m  624 S    0 41.3   0:15.60 clamd

 4241 amavis    34  19  3316  852  796 S    0  0.2   0:00.02 freshclam

 4300 amavis    15   0 76068 2096 1632 S    0  0.4   0:01.75 amavisd

 6126 amavis    16   0 78792  44m 2912 S    0  8.3   0:01.81 amavisd

 7111 amavis    15   0 77208  42m 2912 S    0  7.9   0:00.72 amavisd
```

This results in my system swapping memory all the time and its driving me crazy!

Until before Christmas I used to run quite happily without swapping etc.

Does anyone have any ideas?

Rich.

----------

## magic919

So what changed?  Something must have if it didn't used to do this.

However, I've always found it to be a memory hog.  A quick restart of the process brings a significant drop.

----------

## nitro322

I'm having the same issue:

```
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

 3636 clamav    18   3  407m 266m 1096 S    0 26.1   4:24.20 clamd
```

I don't suppose you ever found a fix?

----------

## richard.scott

I think it was because I was using external signature db's from msrbl.com that looked eating up memory each time they updated at night.

Recently tho, things have been ok. i'm not sure if the upgrade to clamav-0.95.1 fixed it or something else?

----------

## nitro322

Hmm...  I'm just using the default signatures provided by freshclam, so I that shouldn't be the problem here.  I'm also still using version 0.94.2, which is the latest stable version.  I had seen that that 0.95.1 was available, but I'm trying to stick with "stable" packages on this server.  Guess I'll need to try upgrading, though.  I restarted clamd shortly after posting my previous message, and it jumped to nearly 200 MB almost instantly.  Now, it's back up to 330 MB again.

Thanks for the feedback.  I'll try updating and post back the results.

----------

## richard.scott

Don't forget that the 0.95 packages are stable from ClamAV, its just in the Gentoo world they aren't.

I've always used the unstable Gentoo ClamAV package and never had an issue.

----------

