https://github.com/azer/memdiff
BDD style memory leak hunting tool
https://github.com/azer/memdiff
Last synced: 8 months ago
JSON representation
BDD style memory leak hunting tool
- Host: GitHub
- URL: https://github.com/azer/memdiff
- Owner: azer
- Created: 2013-02-17T09:35:36.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2014-03-18T00:48:53.000Z (over 12 years ago)
- Last Synced: 2024-05-14T10:22:25.110Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 174 KB
- Stars: 153
- Watchers: 12
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## memdiff [](https://travis-ci.org/azer/memdiff)
BDD style memory leak hunting tool. See [example/simple.js](#example)

## Warning
Memdiff is experimental. I've been noticing some inconsistency, haven't had time for checking out and fixing yet.
## Install
```bash
$ npm install -g memdiff
```
Requires Node v0.8.x
## Usage
```bash
$ memdiff --help
```
```js
// example/simple.js
function SimpleClass(){}
var leaks = [];
describe('SimpleClass', function(){
it('is leaking', function(){
leaks.push(new SimpleClass);
});
it('is async and not leaking', function(done){
new SimpleClass;
process.nextTick(done);
});
});
```
```js
var memdiff = require('memdiff');
function SimpleClass(){}
var leaks = [];
function leaking(){
leaks.push(new SimpleClass);
}
memdiff(leaking, function(result){ // or memdiff({ fn: leaking, duration: 15, times: 9999, interval: 1 ....
console.log('leaking: ', result.size);
});
```