Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heapdump-sample

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heapdump-sample

setup a sampling interval for heap snapshots

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

heapdump-sample

Setup a sampling interval for heap snapshots. This adds content to the "samples" field of heap snapshots and allows for determining when objects where allocated.

usage

This must be used in conjunction with --track-heap-objects or the corresponding C++ call. Otherwise it will cause a segfault.

require('heapdump-sample').sample();

starting and stopping tracking

The module exports functions to start and stop object tracking for convenience.

heapdump_sample.startTrackingHeapObjects(bool_should_trace_allocation_stacks);
heapdump_sample.stopTrackingHeapObjects();

Tracing allocation stacks can be memory intensive, it should not be used indefinitely. For production purposes you should not run tracking at all times, instead turn it on temporarily when you are debugging behavior.

output to fd

There is the ability to get data out of the samples in real time by providing an FD to work with.

require('heapdump-sample').sample(process.stdout.fd);

The sample will be available in the JSON representation of a heap snapshot (available via the heapdump module).

require flag usage

Use -r heapdump-sample/register to get samples on an interval.

The interval defaults to 50 milliseconds, and can be changed by setting the NODE_HEAPDUMP_SAMPLE_RATE environment variable.

FAQs

Package last updated on 02 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc