Out of memory

Report bugs and workarounds
Post Reply
rolfkunst
Posts: 11
Joined: 29 Apr 2014 12:14

Out of memory

Post by rolfkunst »

Hi everyone,

First of all, great project!

But.. I'm running into the following problem, some now and then i'm not receiving any mails anymore. When I look in the webconsole, I see a few mails in the inbound mail queue ( depending how long I waited to look in the console). In the list of 50 last messages I see those messages over and over again. The number of total messages e.g. is 239333 and going up.

When I look in the appliance self, I see immediately an error: Out of memory: Kill process 5733 (clamd) score 205 or sacrifice child.

I don't understand why I'm running out of memory, I gave my virtual machine 2 vcpu, and 2 GB of memory, it is processing a total of 50 mails a day. That's it!

I'm running version 3.0.0.6

What can I do?

With regards,
Rolf Kunst
DaN
Posts: 240
Joined: 19 Nov 2014 10:04
Location: Earth

Re: Out of memory

Post by DaN »

Hi,

Does

Code: Select all

free -m
show, that your vm is out of free memory?

Yes:
shut down
increase the memory to 2,5 or 3 GB
start the vm

Is this an option?
If not, i think you should disable not needed services.
rolfkunst
Posts: 11
Joined: 29 Apr 2014 12:14

Re: Out of memory

Post by rolfkunst »

Hi, thanks for Your response.

The server states that it is out of memory when I checked.

Mem:
Total: 1877
Used: 1327
Free: 549
Shared: 3
Buffers: 80
Cached: 675
Swap: 0, 0, 0

Is it enough? If it was a Windows machine, I would say yes. But with Linux...
DaN
Posts: 240
Joined: 19 Nov 2014 10:04
Location: Earth

Re: Out of memory

Post by DaN »

For comparison my vm:

Mem:
Total: 1877
Used: 1624
Free: 253
Shared: 0
Buffers: 136
Cached: 606
Swap: 0, 0, 0

Did you checked the ESX(i) health?
Last edited by DaN on 17 Mar 2016 13:10, edited 1 time in total.
kommunen
Posts: 11
Joined: 25 Apr 2014 09:47

Re: Out of memory

Post by kommunen »

Depending on the root cause of your OOM problem it might not help but I suggest adding a swap file to your system.
For some reason EFA doesn't set up any swap during install so it has to be done manually.

Code: Select all

dd if=/dev/zero of=/var/SWAPFILE.swp bs=100M count=20
mkswap /var/SWAPFILE.swp
swapon /var/SWAPFILE.swp
creates a 2GB swapfile in /var and activates it.
Put the swapon command in /etc/rc.local as well so it'll activate on reboot.

Type 'top' and press 'm' to see which processes use the most memory.
clamd and the MailScanner processes should be on top, on my system their VIRT/RES numbers are 950/420 and 330/100 megabyte.

- Peder
rolfkunst
Posts: 11
Joined: 29 Apr 2014 12:14

Re: Out of memory

Post by rolfkunst »

Hi kommunen,

Thank you for your response,

I created the swapfile, I will let you know how it goes!

Thank you!
rolfkunst
Posts: 11
Joined: 29 Apr 2014 12:14

Re: Out of memory

Post by rolfkunst »

The swapfile is gone after a reboot, is there a way to make it permanent?

Thanks!
kommunen
Posts: 11
Joined: 25 Apr 2014 09:47

Re: Out of memory

Post by kommunen »

It shouldn't be gone. I've rebooted my server several times and it's still there.
Are you sure it's just that it isn't active, i.e. you forgot to add the 'swapon /var/SWAPFILE.swp' command to /etc/rc.local ?
What does a 'ls -la /var/SWAPFILE.swp' show?

If it really isn't there it might be that some boot script wipes ".swp" files. Mine is actually just called SWAP (/var/SWAP) , perhaps that's why it survived reboots.

- Peder
Post Reply