[erlang-questions] "fat burner" GC on periodic base?
Attila Rajmund Nohl
Tue Apr 24 12:41:48 CEST 2012
2012/4/24 Valentin Nechayev <>:
> My questions are:
> 1. Is there another way to achieve the same result, as avoiding keeping
> useless data, on timed basics instead of reduction count, which, as
> shown above, doesn't work enough?
You can subscribe to "heap used by process is too large" events using
erlang:system_monitor/2. You can also make an educated guess based on
the code to call garbage collection at certain points in the code (for
example we have a gen_server that uses quite some memory during
initialization, but then it releases most of the memory, so we have an
explicit garbage collection at the end of the init function).
More information about the erlang-questions