[erlang-questions] erlang:send_after/3 questions

Michael Truog <>
Sat Sep 22 01:25:05 CEST 2012

On 09/21/2012 03:15 PM,  wrote:
>> 3. Is spawning a lot of send_after's or timers a dangerous idea? In case of
>> using timer module, we'll just lose some started timers due to port
>> restart. But something tells me that crash of erlang internal timers is a
>> somewhat more dangerous thing that might even crash the VM.
> Not sure I understand you here.
> These timers are a facility built directly into ERTS. If there were a
> bug somewhere in the implementation, that could be as horribly nasty
> as any other bug in ERTS. Other than that, they are dead pieces of
> data interpreted in some conventional way by a bunch of C code, so
> as such they can't really "crash" in any obvious meaning of the
> word.

I remember reading about problems using the timer module with a large number of timers because of excessive memory consumption, such that erlang:send_after/3 or erlang:start_timer/3 is generally the preferred approach.  I don't have a link to the mailing list message(s) for instances of that problem, but I assume it is still an issue today, because of extra storage used by the timer module.

More information about the erlang-questions mailing list