{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/3373","labels_url":"https://api.github.com/repos/meteor/meteor/issues/3373/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/3373/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/3373/events","html_url":"https://github.com/meteor/meteor/issues/3373","id":52936305,"number":3373,"title":"Meteor server restarted, memory leaks","user":{"login":"RobertLowe","id":601141,"avatar_url":"https://avatars.githubusercontent.com/u/601141?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertLowe","html_url":"https://github.com/RobertLowe","followers_url":"https://api.github.com/users/RobertLowe/followers","following_url":"https://api.github.com/users/RobertLowe/following{/other_user}","gists_url":"https://api.github.com/users/RobertLowe/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertLowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertLowe/subscriptions","organizations_url":"https://api.github.com/users/RobertLowe/orgs","repos_url":"https://api.github.com/users/RobertLowe/repos","events_url":"https://api.github.com/users/RobertLowe/events{/privacy}","received_events_url":"https://api.github.com/users/RobertLowe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/meteor/meteor/milestones/3","labels_url":"https://api.github.com/repos/meteor/meteor/milestones/3/labels","id":853385,"number":3,"title":"Tool Performance and Stability","description":"Tasks we're working on in late 2014 as a push to improve the performance and stability of the Meteor command-line tool.","creator":{"login":"glasser","id":16724,"avatar_url":"https://avatars.githubusercontent.com/u/16724?v=3","gravatar_id":"","url":"https://api.github.com/users/glasser","html_url":"https://github.com/glasser","followers_url":"https://api.github.com/users/glasser/followers","following_url":"https://api.github.com/users/glasser/following{/other_user}","gists_url":"https://api.github.com/users/glasser/gists{/gist_id}","starred_url":"https://api.github.com/users/glasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glasser/subscriptions","organizations_url":"https://api.github.com/users/glasser/orgs","repos_url":"https://api.github.com/users/glasser/repos","events_url":"https://api.github.com/users/glasser/events{/privacy}","received_events_url":"https://api.github.com/users/glasser/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":28,"state":"open","created_at":"2014-11-04T19:17:27Z","updated_at":"2015-01-08T23:22:18Z","due_on":null,"closed_at":null},"comments":16,"created_at":"2014-12-26T19:30:32Z","updated_at":"2015-01-12T23:07:28Z","closed_at":null,"body":"Hey Guys,\r\n\r\nSo I noticed one of my applications became slower and slower, it was taking upwards to 60+ seconds to restart (it had probably been up for a day or so), I started to dig into why and killed the instance, I then run `meteor` again and the app was running much better under 5 seconds or so for a restart. I pondered as to why, I by chance saw the memory usage going up after each refresh, and I had my answer. I decided to do some deeper investigation. I created an example app `meteor create --example todos` and started it up, at launch it was at 165mb, after modifying a single file (`server/bootstrap.js`) with newlines and meteor refreshing, it jumped by 5mb or so. Within 10 modifications and refreshes the memory had spiked to 190mb, about 3.5mb per refresh.\r\n\r\nI went to compare with my application, which uses jade, sass, less, and coffee, a bunch of preprocessors, it started at 300mb, the app isn't large per say, but it's not tiny like the todos example app either. After 10 modifications and refreshes, my app had increased to 347mb, my application appears to be leaking 4.7mb per refresh.\r\n\r\nI did some additional testing, and it seems like \"Client modified -- refreshing\" leaked more then \"Meteor server restarted\"; so modifying HTML source (jade) appears to leak more then modifying code (coffee) from my digging but I couldn't confirm anything for sure just that memory is leaking linearly. Finally, jumps in memory seem random from 0.5-10mb, so if you don't notice it, try a couple more times.\r\n\r\nBoth apps were run under `v1.0.2.1`. I'm also on OSX `v10.9.5`. Everything is on my root drive (an SSD).\r\n\r\nThought I would report my finding.\r\n\r\nCheers."},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/69665320","html_url":"https://github.com/meteor/meteor/issues/3373#issuecomment-69665320","issue_url":"https://api.github.com/repos/meteor/meteor/issues/3373","id":69665320,"user":{"login":"danopia","id":40628,"avatar_url":"https://avatars.githubusercontent.com/u/40628?v=3","gravatar_id":"","url":"https://api.github.com/users/danopia","html_url":"https://github.com/danopia","followers_url":"https://api.github.com/users/danopia/followers","following_url":"https://api.github.com/users/danopia/following{/other_user}","gists_url":"https://api.github.com/users/danopia/gists{/gist_id}","starred_url":"https://api.github.com/users/danopia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danopia/subscriptions","organizations_url":"https://api.github.com/users/danopia/orgs","repos_url":"https://api.github.com/users/danopia/repos","events_url":"https://api.github.com/users/danopia/events{/privacy}","received_events_url":"https://api.github.com/users/danopia/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T23:07:28Z","updated_at":"2015-01-12T23:07:28Z","body":"Cool, here's a repro I made. https://github.com/danopia/meteor-reload-repro\r\n\r\nJust run poke.sh and it'll fire up a meteor server and poke the server every minute, you should see it in a CPU chart app.\r\n\r\nNow check back 20 or 30 minutes later and see if the CPU time used by each reload is still the same.\r\n\r\nIf you're impatient, just poke the server manually."}}