[erlang-questions] error_logger and the perils of asynchronicity

Per Melin <>
Sat May 16 20:28:25 CEST 2009


Steve Davis:
> I'm not sure I understand your message:
>
> Doesn't the first case suggest that it _is_ the synchronous io:format/write
> in error_logger that's causing the backup?

That's three different things: synchronous (to the inbox) processing,
use of io:format (or io_lib:format) and writing to disk.

My points:
1) error_logger could be faster for some cases without being
synchronous for the caller.
2) Letting the message queue fill up in a process that is writing to
disk is a bad idea.
3) io_lib:format being slow is much less of an issue here, and
probably in most other cases that don't involve SASL error reports.

> Doeen't the second case (>20Mb messages) look suspiciously like there could
> be something like memory paging going on (i.e. something else entirely)?

I focused entirely on the memory usage in the second case and didn't
even consider that is was also slowish. That I do believe is due to
io_lib:format. But what can one expect when pretty-printing 400 MB?

> ...how much physical RAM does this laptop have? i.e. is the OS paging
> out the memory?

4 GB. No.



More information about the erlang-questions mailing list