{"action":"created","issue":{"url":"https://api.github.com/repos/rvagg/nan/issues/300","labels_url":"https://api.github.com/repos/rvagg/nan/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/rvagg/nan/issues/300/comments","events_url":"https://api.github.com/repos/rvagg/nan/issues/300/events","html_url":"https://github.com/rvagg/nan/issues/300","id":65922961,"number":300,"title":"Integrating NaN with a native addon shows reduced performance and increased memory footprint.","user":{"login":"GayathriKaliyamoorthy","id":1172275,"avatar_url":"https://avatars.githubusercontent.com/u/1172275?v=3","gravatar_id":"","url":"https://api.github.com/users/GayathriKaliyamoorthy","html_url":"https://github.com/GayathriKaliyamoorthy","followers_url":"https://api.github.com/users/GayathriKaliyamoorthy/followers","following_url":"https://api.github.com/users/GayathriKaliyamoorthy/following{/other_user}","gists_url":"https://api.github.com/users/GayathriKaliyamoorthy/gists{/gist_id}","starred_url":"https://api.github.com/users/GayathriKaliyamoorthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GayathriKaliyamoorthy/subscriptions","organizations_url":"https://api.github.com/users/GayathriKaliyamoorthy/orgs","repos_url":"https://api.github.com/users/GayathriKaliyamoorthy/repos","events_url":"https://api.github.com/users/GayathriKaliyamoorthy/events{/privacy}","received_events_url":"https://api.github.com/users/GayathriKaliyamoorthy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-02T13:21:25Z","updated_at":"2015-04-02T21:36:40Z","closed_at":null,"body":" I have integrated NaN into my native addon. These are observations.\r\n\r\n1. Valgrind shows direct memory leak of 56 bytes for every buffer object that's allocated through NanNewBufferHandle. My observation in NaN implementation, every object is wrapped over NanNew(), which is wrapping the object over a Local handle and then returned. In my earlier implementation, I didn't do this wrapping of Buffer over a Local handle and Valgrind did not report any leaks.\r\n\r\n2. I ran the addon module for 2 hours. Memory footage increased to 1.7GB quite rapidly and thus the performance of the addon(with NaN) Module dropped significantly when compared with the performance of addon(without NaN).\r\n\r\nSo the concern is, should wrap every object over(NanNull, NanUndefined, NanBufferHandle, etc) with  NanNew() and then return? Any insights into reason behind this performance drop would be helpful.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/rvagg/nan/issues/comments/89051073","html_url":"https://github.com/rvagg/nan/issues/300#issuecomment-89051073","issue_url":"https://api.github.com/repos/rvagg/nan/issues/300","id":89051073,"user":{"login":"mathiask88","id":4368785,"avatar_url":"https://avatars.githubusercontent.com/u/4368785?v=3","gravatar_id":"","url":"https://api.github.com/users/mathiask88","html_url":"https://github.com/mathiask88","followers_url":"https://api.github.com/users/mathiask88/followers","following_url":"https://api.github.com/users/mathiask88/following{/other_user}","gists_url":"https://api.github.com/users/mathiask88/gists{/gist_id}","starred_url":"https://api.github.com/users/mathiask88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathiask88/subscriptions","organizations_url":"https://api.github.com/users/mathiask88/orgs","repos_url":"https://api.github.com/users/mathiask88/repos","events_url":"https://api.github.com/users/mathiask88/events{/privacy}","received_events_url":"https://api.github.com/users/mathiask88/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T21:36:40Z","updated_at":"2015-04-02T21:36:40Z","body":"I wrote an addon that uses NanNewBuffer and the app that uses the addon calls the function every ~100ms and runs on a 1gb ram system for weeks. I don't know the exact ram usage,  but if it leaks it would not run so long, so I can't confirm this."}}