[erlang-questions] Where are the binaries in message queue but not part of process_info(Pid, binary) ?

Lukas Larsson lukas@REDACTED
Tue Oct 17 16:37:02 CEST 2017


Hello,

On Tue, Oct 17, 2017 at 4:00 PM, Bekes, Andras G <
Andras.Bekes@REDACTED> wrote:

> While investigating a system that transfers lots of refc binaries, I tried
> measuring the amount of data in the message queue of a process. I noticed
> that the binaries in the message queue are not always included in the
> result of process_info(Pid, binary).
>
> In particular, when observing the binaries, I see time intervals when each
> of the new messages appear in the binary list, and time intervals when the
> binary list stays the same regardless of new messages in the queue.
>

erlang:process_info(Pid, binary) returns the binaries that are currently on
the heap of the process. Binaries in messages that have not yet been
received may or may not be part of the heap depending on internal emulator
optimizations.

The message_queue_data process flag explains this a little more and also
gives a way to control it to some extent.

http://erlang.org/doc/man/erlang.html#process_flag_message_queue_data

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171017/aeb59ac4/attachment.htm>


More information about the erlang-questions mailing list