{"action":"created","issue":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/42","labels_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/42/comments","events_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/42/events","html_url":"https://github.com/nickdesaulniers/node-nanomsg/pull/42","id":57760924,"number":42,"title":"free nn_recv() buf","user":{"login":"reqshark","id":937826,"avatar_url":"https://avatars.githubusercontent.com/u/937826?v=3","gravatar_id":"","url":"https://api.github.com/users/reqshark","html_url":"https://github.com/reqshark","followers_url":"https://api.github.com/users/reqshark/followers","following_url":"https://api.github.com/users/reqshark/following{/other_user}","gists_url":"https://api.github.com/users/reqshark/gists{/gist_id}","starred_url":"https://api.github.com/users/reqshark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reqshark/subscriptions","organizations_url":"https://api.github.com/users/reqshark/orgs","repos_url":"https://api.github.com/users/reqshark/repos","events_url":"https://api.github.com/users/reqshark/events{/privacy}","received_events_url":"https://api.github.com/users/reqshark/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-16T03:13:30Z","updated_at":"2015-02-17T18:31:50Z","closed_at":"2015-02-17T17:51:45Z","pull_request":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/pulls/42","html_url":"https://github.com/nickdesaulniers/node-nanomsg/pull/42","diff_url":"https://github.com/nickdesaulniers/node-nanomsg/pull/42.diff","patch_url":"https://github.com/nickdesaulniers/node-nanomsg/pull/42.patch"},"body":"don't memory leak incoming messages onto the `HEAP`\r\n\r\n• use the return value, `len` from `nn_recv()` to set the length of the `memcpy` to a node buffer that is later garbage collected by V8"},"comment":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/comments/74722865","html_url":"https://github.com/nickdesaulniers/node-nanomsg/pull/42#issuecomment-74722865","issue_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/42","id":74722865,"user":{"login":"reqshark","id":937826,"avatar_url":"https://avatars.githubusercontent.com/u/937826?v=3","gravatar_id":"","url":"https://api.github.com/users/reqshark","html_url":"https://github.com/reqshark","followers_url":"https://api.github.com/users/reqshark/followers","following_url":"https://api.github.com/users/reqshark/following{/other_user}","gists_url":"https://api.github.com/users/reqshark/gists{/gist_id}","starred_url":"https://api.github.com/users/reqshark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reqshark/subscriptions","organizations_url":"https://api.github.com/users/reqshark/orgs","repos_url":"https://api.github.com/users/reqshark/repos","events_url":"https://api.github.com/users/reqshark/events{/privacy}","received_events_url":"https://api.github.com/users/reqshark/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T18:31:50Z","updated_at":"2015-02-17T18:31:50Z","body":"thanks, glad to contribute! i had done some local machine profiling with xcode, but I started wondering about it because I would leave the process on overnight remotely over a server, like you could do that with a couple pub/subs. i probably should have used dtrace but i dont have that on my server...\r\n\r\nanyway i was sending small message sizes around 1K or less about every `25ms`. after like a day or two, leaving it on for at least 24 hours, the node process would begin to slow down, skipping messages more frequently and behaving sporadically just before ultimately crashing. Immediately upon restart it would jump right back to the original awesome perf you get out of it.. so i let it run a while doing that a few times just to confirm this wasn't a fluke. takes a few days a figure that out, and if you use daemonize or do auto-revive after exit then this behavior might not have been noticeable. \r\n\r\nalthough it seemed like the heap size was growing, sometimes memory allocations and garbage collection in V8 acts biological... moreover, i'm suspicious of what node or libuv thinks it's adding to the heap because memory leaks are sometimes not so traceable, even when you're following inodes around... well whether or not that was a memory leak, and if this update has anything to do with that, I think it'll be good to continue monitoring it."}}