{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails/issues/3164","labels_url":"https://api.github.com/repos/balderdashy/sails/issues/3164/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails/issues/3164/comments","events_url":"https://api.github.com/repos/balderdashy/sails/issues/3164/events","html_url":"https://github.com/balderdashy/sails/issues/3164","id":101974939,"number":3164,"title":"Memory Leak","user":{"login":"kennysmoothx","id":6720728,"avatar_url":"https://avatars.githubusercontent.com/u/6720728?v=3","gravatar_id":"","url":"https://api.github.com/users/kennysmoothx","html_url":"https://github.com/kennysmoothx","followers_url":"https://api.github.com/users/kennysmoothx/followers","following_url":"https://api.github.com/users/kennysmoothx/following{/other_user}","gists_url":"https://api.github.com/users/kennysmoothx/gists{/gist_id}","starred_url":"https://api.github.com/users/kennysmoothx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennysmoothx/subscriptions","organizations_url":"https://api.github.com/users/kennysmoothx/orgs","repos_url":"https://api.github.com/users/kennysmoothx/repos","events_url":"https://api.github.com/users/kennysmoothx/events{/privacy}","received_events_url":"https://api.github.com/users/kennysmoothx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-19T19:08:02Z","updated_at":"2015-08-27T01:07:49Z","closed_at":null,"body":"So I had an existing project I converted from Sails 0.10 to 0.11 which has been on production and everything was **perfect**.\r\n\r\nI recoded this project from a fresh configuration on sails 0.11 and I pushed this up to production today and I am coming across a memory leak (600mb +).\r\n\r\nMy sails application uses Sockets HEAVILY.. no less than 100-200 active connections at any given moment and my application's memory jumped to 550MB range within 5 minutes. Then trickles on upwards at about 6-10mb/minute...\r\n\r\nI believe this is caused by Sockets due to the nature of how fast the memory shoots up to that range (Sockets reconnecting back with sails may be causing this memory to increase).\r\n\r\nI use Redis for my Sessions however not for Sockets... Any idea where my memory leak can be coming from? Maybe I forgot to configure some aspect of the Sails App?\r\n\r\nAny help is appreciated.\r\n\r\n**UPDATE:**\r\n\r\nGoing over my router logs there is a significant number of \"Polling\" requests taking upward of 25+ seconds to respond, some of which cause heroku timeouts (those that take longer than 30s).\r\n\r\n```\r\nheroku[router]: at=info method=GET path=\"/socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_sdk_platform=browser&__sails_io_sdk_language=javascript&EIO=3&transport=polling&t=1440016503005-19337&sid=Lpzc6wgYY9yGFMPlAAIA\"\r\nhost=OMITTED request_id=d725d339-5d64-4ee4-8a27-99ed08132d0f \r\nfwd=\"OMITTED\" dyno=web.1 \r\nconnect=0ms service=25048ms status=200 bytes=207\r\n```\r\n\r\nWill continue investigating..\r\n\r\nMight be related to #3099 even without cluster mode."},"comment":{"url":"https://api.github.com/repos/balderdashy/sails/issues/comments/135227229","html_url":"https://github.com/balderdashy/sails/issues/3164#issuecomment-135227229","issue_url":"https://api.github.com/repos/balderdashy/sails/issues/3164","id":135227229,"user":{"login":"kennysmoothx","id":6720728,"avatar_url":"https://avatars.githubusercontent.com/u/6720728?v=3","gravatar_id":"","url":"https://api.github.com/users/kennysmoothx","html_url":"https://github.com/kennysmoothx","followers_url":"https://api.github.com/users/kennysmoothx/followers","following_url":"https://api.github.com/users/kennysmoothx/following{/other_user}","gists_url":"https://api.github.com/users/kennysmoothx/gists{/gist_id}","starred_url":"https://api.github.com/users/kennysmoothx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennysmoothx/subscriptions","organizations_url":"https://api.github.com/users/kennysmoothx/orgs","repos_url":"https://api.github.com/users/kennysmoothx/repos","events_url":"https://api.github.com/users/kennysmoothx/events{/privacy}","received_events_url":"https://api.github.com/users/kennysmoothx/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T01:07:49Z","updated_at":"2015-08-27T01:07:49Z","body":"So the memory leak has been persistant and it makes it's way passed 1GB. I took a series of Heapdump and different times of the day and they all have a single glaring similarity:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/6720728/9510113/01802946-4c36-11e5-920b-3d91af15dbd2.png)\r\n\r\n\r\n![image](https://cloud.githubusercontent.com/assets/6720728/9510117/1747989a-4c36-11e5-92fb-9a0da8739c25.png)\r\n\r\n\r\nNow I have a really hard time reading heap dumps so if there is any more information you need from this please feel free to ask! I can post back with any more information.\r\n\r\nAlso 'Featured' is a sails model I have. It really is only referenced twice in my code and there are only two queries and there is nothing out of the norm about them. "}}