[erlang-questions] inspect process mailbox size

krad humeafo@REDACTED
Fri Dec 21 04:22:33 CET 2012


a further question is, is there anyway to restrict the mailbox size?

On Sunday, February 1, 2009 3:11:14 AM UTC+8, Geoff Cant wrote:
>
> Cliff Moon <cl...@REDACTED <javascript:>> writes:
>
> > is there any way to inspect mailbox size at runtime?  Under load testing 
> > I'm seeing conditions pop up where a node will go out of control due to 
> > mailbox growth and it's rather hard to debug the issue post mortem from 
> > crash dumps.
>
> erlang:process_info/2 is very helpful for this:
> erlang:process_info(Pid, messages_queue_len) gives you the length of the
> queue and erlang:process_info(Pid, messages) gives you the queue itself.
>
> A common cause of mailbox blowout is that the process is blocked waiting
> for a reply from something - in this case erlang:process_info(Pid,
> backtrace) and erlang:process_info(Pid, current_function) can help you
> figure out what it might be waiting for.
>
> Cheers,
> -- 
> Geoff Cant
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121220/e11a0df6/attachment.htm>


More information about the erlang-questions mailing list