Skip to content

mcollina/memwatch-sigusr2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

memwatch-sigusr2

Do a heap diff on SIGUSR2 in node. Wraps completely memwatch-next and offers the same API.

Install

npm install memwatch-sigusr2 --save

Usage

In your leaking app:

var memwatch = require('memwatch-sigusr2')
memwatch.setup()

// to get the process PID, omit in production and use ps aux | grep node
console.log(process.pid)

Then to start calculating the diff, run:

kill -sigusr2 <PID>

To stop calculating the diff, run:

kill -sigusr2 <PID>

Then, you can read your diff with:

jsonlint /tmp/heap-diff-<PID>.json

Check jsonlint for installation and usage instructions.

Acknowledgements

This project was kindly sponsored by nearForm.

License

MIT

About

Do a heap diff on SIGUSR2 in node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published