[rabbitmq-discuss] RabbitMQ crashes hard when it runs out of memory

Matthias Radestock matthias at lshift.net
Fri Oct 23 00:24:11 BST 2009


Stephen,

Stephen Day wrote:
> (rabbit at vs-dfw-ctl11)5> [erlang:garbage_collect(P) || P <- 
> erlang:processes()].
> [true,true,true,true,true,true,true,true,true,true,true,
>  true,true,true,true,true,true,true,true,true,true,true,true,
>  true,true,true,true,true,true|...]
> 
> (rabbit at vs-dfw-ctl11)6> 
> memory().                                             
> [{total,145833144},
>  {processes,50900752},
>  {processes_used,50896864},
>  {system,94932392},
>  {atom,514765},
>  {atom_used,488348},
>  {binary,24622512},
>  {code,3880064},
>  {ets,64745716}]
> 
> This really cut down on usage, so its likely that the binary gc is 
> falling behind rabbits requirements.

Agreed.

> How do I track down the uncollected binary heap usage to a process?

Binaries are shared between processes and ref counted, so no single 
process owns them. There is a process_info item called 'binary' that 
provides information on the binaries referenced by a process, but I've 
never looked at that myself, so don't know how useful the contained info is.

One thing you could try is to run the above garbage_collect code 
interleaved with the memory reporting code to identify which process 
results in the biggest drop in memory memory usage when gc'ed.


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list