[erlang-questions] Process overhead

Christian <>
Wed Jun 17 16:21:27 CEST 2009


You can improve on solution 1 by using the
{next_state,NextStateName,NewStateData,hibernate} form of return from
the State-callbacks. The gen-behaviors will then backend in this
feature:

http://www.erlang.org/doc/man/erlang.html#erlang:hibernate-3

But you have not mentioned having a problem with the memory usage, so
I wonder if this is a real problem you have (and are trying to find a
solution for)?

You know... benchmarks benchmarks benchmarks...

On Wed, Jun 17, 2009 at 14:34, Fredrik
Svensson<> wrote:
> I have a gen_server which handles sessions, and I send messages only
> when the session is active. I am concidering two solutions:
>
> 1. Starting a gen_fsm for each session, each holding the state of the
> session, and ran as long as the session is active.


More information about the erlang-questions mailing list