zeromq/erlzmq2 — Issue #27: erlzmq:term/1 does not release memory
Author: svn12345678
Created: 2011-12-12 06:45:49+00:00
State: open

Dear all,
I encountered a problem with regarding memory handle in erlzmq2.
Please kindly see the bleow:
-module(context_openClose).
-export(ctx_oc/0).

ctx_oc()->
{ok, Context} = erlzmq:context(),
io:format("*** erlzmq:term/1 return ~p ***~n",[erlzmq:term(Context)]).

#start erl shell and run the following command
>
lists:foreach(fun(I)-> context_openClose:ctx_oc(), io:format("[~3..0B] ------~n",[I]), timer:sleep(1500)	end,
lists:seq(1,500)
).

...
*** erlzmq:term/1 return ok ***
[289] ------
** exception error: no match of right hand side value {error,enomem}
in function context_openClose:ctx_oc/0
in call from erl_eval:do_apply/5
in call from erl_eval:exprs/5
in call from lists:foreach/2
----------------------------------------------------------------
It seems that erlzmq:term/1 does not release memory.
Any suggestion will be appreciated.