error_logger and user memory usage

Samuel Rivas <>
Fri May 5 14:07:07 CEST 2006


Matthias Lang wrote:
> Samuel Rivas writes:
> 
>  >   The problem is that after a certain number (less than 4) of consecutive 
>  > failures my system runs out of memory and starts swapping. The processes
>  > that seem to be eating the memory are error_logger and user; even after
>  > stopping the system they use more than 100 M.
> 
> Do things improve if you explicitly GC those processes, i.e. call
> 
>   erlang:garbage_collect(Pid)

  They do. I had wrongly tried erlang:garbage_collect() ...

  Maybe the problem is that their inbox size increases so fast
that they can't handle/output the error reports?

>  >   I reckon the problem are the verbose error reports that are written in
>  > the tty (large messages and large states in the crashing gen_servers).
>  > 
>  >   An easy workaround is removing error_logger_tty_h from the error_logger
>  > and living with sasl error_handler only.
> 
> I'm not sure if this is directly related to your problem, but I had
> problems with gigantic error reports swamping my logging system with
> relatively useless information. I solved it by writing my own code
> to format error reports. The trick is that it limits the length of printouts.
> 
>   http://www.corelatus.se/~matthias/trunc_io.erl
 
  Well, that's also a problem. I'm trying to solve the big one: my system
collapses before supervisors reach a reasonable restart intensity. A 
custom error handler using your idea of limiting the report length may be
the solution for both of them.

Thanks! 
-- 
	Samuel



More information about the erlang-questions mailing list