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
- Host: GitHub
- URL: https://github.com/hzzhujf/heapsnapshot.js
- Owner: hzzhujf
- License: mit
- Created: 2018-10-11T07:34:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-11T10:36:07.000Z (over 6 years ago)
- Last Synced: 2025-02-04T22:39:20.837Z (3 months ago)
- Topics: gc, heap, js, memory, nodejs, snapshot, v8
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# 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`