[erlang-questions] inspect process mailbox size
Fri Dec 21 05:16:45 CET 2012
I'm not aware of any way to do that (but please let me know if there
is one). However, this past thread may be helpful to you:
On Fri, Dec 21, 2012 at 8:52 AM, krad <humeafo@REDACTED> wrote:
> 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> 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.
>> Geoff Cant
> erlang-questions mailing list
More information about the erlang-questions