Open Sergey-Terekhin opened 9 years ago
_socket
is SubscribeSocket
I expect this is an issue with nanomsg itself because NNanomsg is all managed code. We are using the last nanomsg release (v0.5). I believe there are substantial fixes after this in master, though I also believe it currently doesn't compile under Windows. You could try compiling a more recent version of nanomsg and see if that fixes the issue.
But actually, how are you measuring that? if you're just watching the process size grow, it'll just be that the GC isn't freeing memory allocated in Receive method very quickly - it will eventually.
I use memory profiler (dotMemory) and see that manage memory is freed but unmanaged slowly grows. I'll try to build latest release of nanomsg and check leaks there
Sergey - Is this specific to a transport?
I found an issue with the handling of zero-byte messages and subscriptions which could produce a native leak. Seems unlikely, but any chance that this is what you're seeing Sergey?
If not, please include some more details about your platform and scenario. I couldn't reproduce this for non-zero length messages on any of the transports.
I've found memory leak with non-zero messages (I've not tested zero-byte messages). And it is seems to be independent of message size - something like unmanaged descriptor leak. I see memory leaks on Windows 7 Pro x64, but where are no any leaks on Windows 8.1 Pro x64. I'll check this more carefully I use tcp transport for pub-sub sockets and localhost connection
Any updates on this issue?
There is a new version of nanomsg out (0.6) that I haven't added binaries for because I don't currently have a windows machine ... This version evidently fixes a number of issues so it might be worth trying that. The new binaries should be able to be just dropped in without changes to NNanomsg (compile instructions are in the NNanomsg readme). I've been thinking it might also be worth trying to wrap mangos - the go implementation which is evidently much more stable at this point. I haven't looked into it but I believe it to be possible.
I recieve memory leaks (few kilobytes per message recieved) when using pub-sub pattern at the subscriber side. It looks independent from recieved message size My code is (simplified):
I use version from NuGet