[erlang-questions] gen_server mailbox scans
Thu Jan 15 05:58:44 CET 2009
2009/1/14 Ben Hood <0x6e6562@REDACTED>
> The issue of excessive mailbox scanning during the bottom half of a
> gen_server call has been brought up at various stages on this list.
> The issue has become of some concern to us, so we have patched the
> gen_server implementation from R11B5 to drain the mailbox in the loop.
> It seems to do the job but I just wanted to get some feedback from
> more knowledgable people before this functionality is merged into our
> main source tree.
> The patched version is available here:
> Any remarks or help is appreciated,
>From a callback point of view, the changes are probably transparent, but:
* process_info(Pid, message_queue_len) will probably lie now because the
mailbox has been drained into an internal queue. If your message queue is
indeed building up in a message storm, diagnosing the problem will become
* And if you did a sys:get_status(Pid) on the gen_server, you will copying
the entire message queue just to view it...
* Crash reports will be MUCH bigger.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions