[erlang-questions] Cost of hibernation

Pablo Polvorin pablo.polvorin@REDACTED
Mon Jul 22 17:26:31 CEST 2013

On 22 July 2013 11:57, Valentin Micic <v@REDACTED> wrote:
> Dear all,
> Erlang reference manual makes a following statement regarding
> erlang:hibernate/3
> "erlang:hibernate(Module, Function, Args)
> Types:
> Module = Function = atom()
> Args = [term()]
> Puts the calling process into a wait state where its memory allocation has
> been reduced as much as possible, which is useful if the process does not
> expect to receive any messages in the near future.
> …"
> I have never used the hibernate function fearing that performance penalty to
> be paid may be to high.  In other words, I never really had to use it ;-)
> But now that I do, may I kindly ask if there is anyone out there that did
> successfully used this feature and has a clear idea regarding performance
> penalty.
> Would it be cheaper to store and retrieve a context using ETS (which would
> certainly complicate programming), or would a call to hibernate do the
> trick?
> Maybe another way to ask this question could be: what is the cost of calling
> a garbage collection frequently?
> Also, would anyone care to define a meaning of "the near future" within this
> context? Should one measure "the near future"  in milliseconds, seconds or
> minutes?
As vague as it is, maybe this helps:
I had used it in a few systems.  In tsung for example (with hundreds
of thousands of processes simulating user behavior),  there was a big
memory saving,  and the time the processes where hibernated was in the
range of seconds,  not minutes.    The difference in cpu usage in that
case was barely noticeable

> Kind regards
> V/
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Pablo Polvorin

More information about the erlang-questions mailing list