Process overhead

Fredrik Svensson <>
Wed Jun 17 14:34:37 CEST 2009


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.
2. Starting gen_fsm:s only to wait for message replys, then terminate
and save the session-id in an ets table. Then starting a new gen_fsm
for each message to handle the responses.

The first solution starts a process for each session, and the second
only starts a process when a sessions is being used and then save the
session-id between messages.

How much is the memory and cpu overhead of each process, do I win
anything by doing the second solution?


/Fredrik


More information about the erlang-questions mailing list