{"action":"created","issue":{"url":"https://api.github.com/repos/request/request-promise/issues/54","labels_url":"https://api.github.com/repos/request/request-promise/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/request/request-promise/issues/54/comments","events_url":"https://api.github.com/repos/request/request-promise/issues/54/events","html_url":"https://github.com/request/request-promise/pull/54","id":97338697,"number":54,"title":"Require just used functions & use natives","user":{"login":"luanmuniz","id":3428149,"avatar_url":"https://avatars.githubusercontent.com/u/3428149?v=3","gravatar_id":"","url":"https://api.github.com/users/luanmuniz","html_url":"https://github.com/luanmuniz","followers_url":"https://api.github.com/users/luanmuniz/followers","following_url":"https://api.github.com/users/luanmuniz/following{/other_user}","gists_url":"https://api.github.com/users/luanmuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/luanmuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luanmuniz/subscriptions","organizations_url":"https://api.github.com/users/luanmuniz/orgs","repos_url":"https://api.github.com/users/luanmuniz/repos","events_url":"https://api.github.com/users/luanmuniz/events{/privacy}","received_events_url":"https://api.github.com/users/luanmuniz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-26T18:12:15Z","updated_at":"2015-07-27T04:09:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/request/request-promise/pulls/54","html_url":"https://github.com/request/request-promise/pull/54","diff_url":"https://github.com/request/request-promise/pull/54.diff","patch_url":"https://github.com/request/request-promise/pull/54.patch"},"body":"Hi,\r\n\r\nI made this because after a few requests using this module, lodash was causing some memory allocation problems, the full file is very big and it was causing me problems.\r\n\r\nI don't quite understand why, but make just these changes, requiring just the used functions and using a few native functions, my application decrease the memory allocation from 500mb to 220mb."},"comment":{"url":"https://api.github.com/repos/request/request-promise/issues/comments/125080031","html_url":"https://github.com/request/request-promise/pull/54#issuecomment-125080031","issue_url":"https://api.github.com/repos/request/request-promise/issues/54","id":125080031,"user":{"login":"analog-nico","id":1407390,"avatar_url":"https://avatars.githubusercontent.com/u/1407390?v=3","gravatar_id":"","url":"https://api.github.com/users/analog-nico","html_url":"https://github.com/analog-nico","followers_url":"https://api.github.com/users/analog-nico/followers","following_url":"https://api.github.com/users/analog-nico/following{/other_user}","gists_url":"https://api.github.com/users/analog-nico/gists{/gist_id}","starred_url":"https://api.github.com/users/analog-nico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analog-nico/subscriptions","organizations_url":"https://api.github.com/users/analog-nico/orgs","repos_url":"https://api.github.com/users/analog-nico/repos","events_url":"https://api.github.com/users/analog-nico/events{/privacy}","received_events_url":"https://api.github.com/users/analog-nico/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T04:09:33Z","updated_at":"2015-07-27T04:09:33Z","body":"Thanks @luanmuniz !\r\n\r\nThat is an important finding I would like to understand better so that future versions don't reintroduce this issue. Can you say something about the following questions?\r\n\r\n1. The code pieces you replaced with native functions are only executed once when you require the module. I expect if you revert them to using lodash functions you still won't have the memory issue. Could you try this out?\r\n2. Apart from the native functions you did (1) require individual lodash functions and (2) update lodash from 3.6.x to ^3.6.0. First of all, which lodash version do you use? Please have a look at `/node_modules/request-promise/node_modules/lodash/package.json`. This may answer whether (1) or (2) resolved the issue."}}