[erlang-questions] inspect process mailbox size
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:
> > 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.
> Geoff Cant
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions