Skip to content

Commit

Permalink
Merge pull request #87 from Financial-Times/memleak
Browse files Browse the repository at this point in the history
Add memwatch to log possible memory leaks
  • Loading branch information
matthew-andrews committed Apr 8, 2015
2 parents e2704d6 + 8577b93 commit 3ea951b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ var handlebars = require('ft-next-handlebars');
var barriers = require('next-barrier-component');
var metrics = require('next-metrics');

// Report suspected memory leaks to Sentry
if(process.env.NODE_ENV === 'production'){
var memwatch = require('memwatch');
memwatch.on('leak', function(info){
errorsHandler.captureException(new Error('Suspected Memory Leak'), {tags:{info:info}});
});
}

var robots = require('./src/express/robots');
var normalizeName = require('./src/normalize-name');

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ft-next-handlebars": "^1.0.1",
"ft-next-logger": "^1.0.0",
"isomorphic-fetch": "^2.0.0",
"memwatch": "^0.2.2",
"next-barrier-component": "Financial-Times/next-barrier-component#v1",
"next-feature-flags-client": "https://github.com/Financial-Times/next-feature-flags-client/archive/v5.1.1.tar.gz",
"next-metrics": "^1.6.1"
Expand Down

0 comments on commit 3ea951b

Please sign in to comment.