limited error_logger dump (vm crashes because of generating dump)

Max Lapshin max.lapshin@REDACTED
Mon Sep 20 08:53:04 CEST 2010

In fact gen_server:format_status doesn't solve the problem:

    format("** Generic server ~p terminating \n"
           "** Last message in was ~p~n"
           "** When Server state == ~p~n"
           "** Reason for termination == ~n** ~p~n",
	   [Name, Msg, State, Reason1]),

This formatting has problems: Reason1 maybe many megabytes big when
state was big and some badmatch has met with it.
Maybe it would be better to format status (change import from
error_logger:format to error_logger_formatter:format) into
limited-size binary in the dying process and only then send data to
error_logger process. It will reduce memory consumption, lower
bottleneck-ness of one-core error_logger.

Speaking about detailed logging: in fact, it is usually interesting to
know first 10-20 lines of termination Reason and process dictionay
with each value, limited to 10-20 lines. Or 20-40. But not 400 000
lines of state dump.

More information about the erlang-questions mailing list