instructions on running node-webkit-agent for debugging memory leaks

This commit is contained in:
Tyler Renelle
2013-02-26 12:42:00 -05:00
parent 7c480124cf
commit 0a3fc9f715
3 changed files with 14 additions and 2 deletions

View File

@@ -22,6 +22,17 @@ process.env.SMTP_SERVICE = conf.get("SMTP_SERVICE");
process.env.STRIPE_API_KEY = conf.get("STRIPE_API_KEY");
process.env.STRIPE_PUB_KEY = conf.get("STRIPE_PUB_KEY");
var agent;
if (process.env.NODE_ENV === 'development') {
// Follow these instructions for profiling / debugging leaks
// * https://developers.google.com/chrome-developer-tools/docs/heap-profiling
// * https://developers.google.com/chrome-developer-tools/docs/memory-analysis-101
agent = require('webkit-devtools-agent');
console.log("To debug memory leaks:" +
"\n\t(1) Run `kill -SIGUSR2 " + process.pid + "`" +
"\n\t(2) open http://c4milo.github.com/node-webkit-agent/21.0.1180.57/inspector.html?host=localhost:1337&page=0");
}
process.on('uncaughtException', function (error) {
function sendEmail(mailData) {