[erlang-questions] gen_server state is not released for gc

Björn-Egil Dahlberg <>
Fri Jan 13 22:48:40 CET 2012


Den 13 januari 2012 21:51 skrev Max Lapshin <>:

> I really thought that hibernating should make full cleanup of process
> state.
>

I am certain that hibernate will achieve the same intended result, i.e. no
lingering procbins:

handle_call(release, _From, _State) ->
  {reply, ok, nothing, hibernate}.

Hibernate is a lot more aggressive, see doc for details, then a gc  but is
also useful in scenarios when you want to shrink idle workers to a minimum.

Of course, you normally don't need to trigger gc:s or a hibernate unless
your application scenario really requires it. Large lingering binaries are
a bit of a problem if the space is tight. In those cases an well placed
explicit gc is well worth the trade off.

// Björn-Egil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120113/9afcbe5d/attachment.html>


More information about the erlang-questions mailing list