[erlang-questions] eheap cannot allocate for which process?

Attila Rajmund Nohl <>
Mon Mar 17 13:36:26 CET 2014


If you're running 32 bit Erlang, only 4 GB of memory is available for a
single process. I think that the stack+heap value is in words, not in
bytes, so on 32 bit Erlang you have to multiply it by 4, but I'm not quite
sure. I my experience usually the processes with the longest queues are
guilty in running out of memory (the process gets stuck, can't handle the
incoming messages, the queue goes large and memory is eventually
exhausted). Even though the queue length is only 1, my suspect is process
<0.21060.67>.


2014-03-17 9:51 GMT+01:00 József Bérces <>:

>  I receive the classic "eheap_alloc: Cannot allocate..." message. It wants
> to allocate ~1GB memory and that fails. That is fine, I am doing something
> wrong. So I took the crash dump and tried to find out which one of my
> processes is the guilty one.
>
>
>
> Unfortunately, I cannot tell it from the crash dump.
>
>
>
> The memory section says:
>
> =memory
>
> total: 15447352528
>
> processes: 15140232809
>
> processes_used: 15140005610
>
> system: 307119719
>
> atom: 512601
>
> atom_used: 496586
>
> binary: 148574400
>
> code: 21228007
>
> ets: 119988984
>
>
>
> I have 16GB RAM, so the processes use almost all. There are 4010
> processes. 1 garbing, 31 scheduled, 3978 waiting. If I sum stack+heap of
> all the processes then I get ~700MB. That is very far from 16GB. Here are
> the top 10 stack+heap processes:
>
> *Pid *
>
> *State*
>
> *Reductions*
>
> *Stack+heap*
>
> *MsgQ Length*
>
> <0.21060.67>
>
> Garbing (limited info)
>
> 1,508,838,180
>
> 145,962,050
>
> 1
>
> <0.25689.27>
>
> Waiting
>
> 86,670,344
>
> 145,962,050
>
> 0
>
> <0.10003.68>
>
> Waiting
>
> 1,363,039
>
> 38,263,080
>
> 0
>
> <0.15943.66>
>
> Waiting
>
> 1,882,465,380
>
> 30,610,465
>
> 0
>
> <0.15879.68>
>
> Waiting
>
> 471,549
>
> 30,610,465
>
> 0
>
> <0.31854.67>
>
> Waiting
>
> 154,500,777
>
> 24,488,375
>
> 0
>
> <0.16221.68>
>
> Waiting
>
> 262,114
>
> 24,488,375
>
> 0
>
> <0.16628.68>
>
> Waiting
>
> 117,268
>
> 24,488,375
>
> 0
>
> <0.15878.68>
>
> Waiting
>
> 453,490
>
> 19,590,700
>
> 0
>
> <0.16235.68>
>
> Waiting
>
> 181,968
>
> 19,590,700
>
> 0
>
>
>
> Any ideas how to tell which process needs ~1GB memory?
>
>
>
> Thanks,
>
> Jozsef
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140317/d5ae3072/attachment.html>


More information about the erlang-questions mailing list