Erlang crashes - unable to allocate memory

Our ejabberd server runs smoothly for a few days and then suddenly crashes.

I have found earling crash dump files in the ejabberd log directory.

When viewing the crash dumps, the problem seems to be due to memory allocation:

=erl_crash_dump:0.1
Sun Jun 20 23:08:43 2010
Slogan: eheap_alloc: Cannot allocate 467078560 bytes of memory (of type "old_heap").
System version: Erlang (BEAM) emulator version 5.6.5 [source] [smp:4] [async-threads:0] [hipe] [kernel-poll:true]

Is there any way that you can somehow specify a fixed amount of memory to allocate to erlang or is there perhaps another solution to this problem?

On average there are only approximately 30 people connected to the ejabberd server at any given time.

At first I was using the ejabberd binary installer and then decided to compile ejabberd from source hoping that it would be better optimised for my platform if it was compiled on the same platform, and it seemed slightly more stable but recently it started crashing again.

qu1cksand

qu1cksand wrote:

=erl_crash_dump:0.1
Sun Jun 20 23:08:43 2010
Slogan: eheap_alloc: Cannot allocate 467078560 bytes of memory (of type "old_heap").
System version: Erlang (BEAM) emulator version 5.6.5 [source] [smp:4] [async-threads:0] [hipe] [kernel-poll:true]

On average there are only approximately 30 people connected to the ejabberd server at any given time.

30 typical Jabber chat users, how can that push ejabberd to require 450 MB of RAM?

In my open server (which may receive attacks, missusers, buggy clients) consumes for 420 concurrent users around 750 MB of RAM. We don't have local transports (no PyICQt, no Spectrum...).

Check if there are error messages in your ejabberd log files. Check if there is any internal table with anormal large size (roster, offline_msg, vcard). In the crash dump, inspect it with "erl -s webtool", maybe you find that some process consumes a lot of memory in its message queue.

qu1cksand wrote:

Is there any way that you can somehow specify a fixed amount of memory to allocate to erlang or is there perhaps another solution to this problem?

I am not aware of any such option. The erlang VM just tries to use as many memory as it needs and is available in the system.

Yeah, I thought it was odd

Yeah, I thought it was odd that it was using so much RAM for such a few users.

The roster is about 14Mb (DCD) and about 3Mb (DCL).

Although there aren't a large number of users, we are using http-bind rather than a stand alone client, and are performing several REST calls using mod_rest to manipulate the roster, get online user count to generate graphs for rrdtool etc.

I was unable to inspect the crash dump using the webtool because the ejabberd server is behind a firewall and doesn't have port 8888 open.

Re: Erlang crashes - unable to allocate memory

You can put your crash dump somewhere so we can investigate it.

Syndicate content