erlang-czmq icon indicating copy to clipboard operation
erlang-czmq copied to clipboard

Memory leak

Open steven807 opened this issue 10 years ago • 2 comments

I think that handle_zframe_recv_nowait has a memory leak. (At least, something does -- this is my best guess as to the problem.) The culprit appears to be in the freeing of terms at the end of the function. There is a call to "erl_free_term(more_boolean)", but "more_boolean" is a pointer to an atom that shouldn't be freed. But there is no free of the tuple, "data_more". I suspect swapping one for the other will fix this leak.

steven807 avatar Jun 04 '14 21:06 steven807

I can confirm this does in fact fix the memory leak, which is quite serious. Just freeing data_more and not more_boolean consistently crashes the czmq-port process.

Thanks @steven807 !

andytill avatar Jun 05 '14 15:06 andytill

Glad to help.

steven807 avatar Jun 05 '14 15:06 steven807