{"action":"opened","issue":{"url":"https://api.github.com/repos/nuxt/nuxt.js/issues/805","repository_url":"https://api.github.com/repos/nuxt/nuxt.js","labels_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/805/comments","events_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/805/events","html_url":"https://github.com/nuxt/nuxt.js/issues/805","id":231943864,"number":805,"title":"Analyze possible memory leaks","user":{"login":"pi0","id":5158436,"avatar_url":"https://avatars3.githubusercontent.com/u/5158436?v=3","gravatar_id":"","url":"https://api.github.com/users/pi0","html_url":"https://github.com/pi0","followers_url":"https://api.github.com/users/pi0/followers","following_url":"https://api.github.com/users/pi0/following{/other_user}","gists_url":"https://api.github.com/users/pi0/gists{/gist_id}","starred_url":"https://api.github.com/users/pi0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pi0/subscriptions","organizations_url":"https://api.github.com/users/pi0/orgs","repos_url":"https://api.github.com/users/pi0/repos","events_url":"https://api.github.com/users/pi0/events{/privacy}","received_events_url":"https://api.github.com/users/pi0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-29T07:13:09Z","updated_at":"2017-05-29T07:13:09Z","closed_at":null,"body":"As of some users are reporting memory leaks in their production environment, I've opened this issue trying to help investigate (possible?) memory leaks causing from Nuxt or SSR engine of vue.js. We may resolve problems before stable 1.0.0 release, but it needs users contribution to help testing different conditions and providing reports & heap dumps. (Related to #678 #661 #658)\r\n\r\n# Testing Environment\r\nIt may be better to create a new and clean repository to prevent side-effects of using third party plugins such as lodash. (they may have memory leaks too)\r\n\r\n- **[Important]** Using **latest** nuxt.js (`1.0.0-alpha`) because it is using `runInNewContext:false` SSR options.\r\n- Using latest stable node.js release, either `6.10.3 LTS` or `7.10.3` (recommended)\r\n- Recommended to use docker isolated containers to prevent side effects of other processes.\r\n- **[Important]** Use `nuxt build`, `nuxt start` and not `nuxt dev`. We are analyzing production environments.\r\n- Recommended to use `yarn` instead of npm to ensure exact dependencies are installed.\r\n\r\n# Testing Procedure\r\nThe article [finding-a-memory-leak-in-node-js](https://blog.risingstack.com/finding-a-memory-leak-in-node-js) may help a lot to take offline heap snapshots. Below is a suggested approach for that. If you are using nuxt programically (in express for example) you may take another approach.\r\n\r\nIn `nuxt.config.js` before `module.exports`:\r\n- Add `heapdump = require('heapdump');` \r\n- Add a `setInterval` to periodically (~15min) take snapshots\r\n\r\nYou can use tools like `ab` to emulate **light** request traffic on web server.\r\n\r\nMeanwhile you may also track memory allocation using any tool you want.  It is recommended to keep server running for more than 1 hour.\r\n\r\n**Important** Please notice about *garbage collection*. Don't try to emulate high memory usage by applying heavy load on SSR engine it may give false positive memory leaks and performance downsides. If actually memory leak exists it may happen even with *normal* amount of requests/load. (See excellent article by eran hammer [performance-at-rest](https://hueniverse.com/performance-at-rest-75bb8fff143).\r\n\r\n# Reports\r\nAfter tests done, you may personally analyze and compare heap dumps using chrome dev tools. Also providing a report in this thread would be so nice. Please at least include following details:\r\n\r\n- Source code repository to reproduce\r\n- Mention [If any] used third party plugin or framework\r\n- Testing environment specs\r\n   - OS\r\n   - Server Resources\r\n   - Exact version of running nuxt and node.js \r\n- Heap dump analyze results / raw files. (2 files maximum)\r\n- Screenshots of memory usage over time\r\n- Other special notes\r\n- Possible leak source"}}
{"actor":{"display_login":"pi0"}}