An open API service indexing awesome lists of open source software.

https://github.com/hzzhujf/heapsnapshot.js

A tool to take a heap snapshot of Node.js via V8 profiler
https://github.com/hzzhujf/heapsnapshot.js

gc heap js memory nodejs snapshot v8

Last synced: 3 months ago
JSON representation

A tool to take a heap snapshot of Node.js via V8 profiler

Awesome Lists containing this project

README

        

![npm](https://img.shields.io/npm/dw/heapsnapshot.js.svg)
![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)

# heapdump.js
A tool to take a heap snapshot via V8 profiler, which is inspired by [Understanding Garbage Collection and hunting Memory Leaks in Node.js](https://www.dynatrace.com/news/blog/understanding-garbage-collection-and-hunting-memory-leaks-in-node-js/)

## required
- Node.js >= 6.4.0
- OSX: This code is only pass-test on OSX platform

## install
```shell
npm install heapsnapshot.js
```

## usage
add this code to the start
```javascript
require('heapsnapshot.js').init()
```
heapsnapshot.init([dataDir][,options])
- `dataDir` the path of folder for heap snapshot file. *Default*:`.`
- `options`
- `interval` the interval millisecond to check the usage of memory. *Default*:`500`
- `step`: the distance between two adjacent threshold. *Default*:`50`
- `threshold`: the initial threshold. *Default*:`0`