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

Max Lapshin max.lapshin@REDACTED
Fri Jan 13 18:51:52 CET 2012


Try to return hibernate flag after your release call and check what will
happen

On Friday, January 13, 2012, Volodymyr Kyrychenko <
vladimir.kirichenko@REDACTED> wrote:
> Hi. Here is simple gen_server that holds binary in its state and never
> releases it.
>
> http://ideone.com/U4f9X
>
> 1> X = myserver:start_link("/tmp/1.cache").
> {ok,<0.33.0>}
> 2> myserver:info().
> {binary,[{140408119021616,401681797,2}]}
> 3> myserver:release().
> ok
> 4>  myserver:info().
> {binary,[{140408119021616,401681797,2}]}
> 7> memory(binary).
> 402043632
>
> How come there are 2 references on it and what to do to free this binary?
>
> --
> Best Regards,
> Volodymyr Kyrychenko
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120113/5188ba2e/attachment.htm>


More information about the erlang-questions mailing list