New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bleed

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bleed

Bleeds memory in a configurable and predictable way.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

bleed

Node.js module to consume memory in a configurable and predictable way.

Usage

$ npm install bleed
var bleed = require('bleed');

bleed(options, callback);

options.bytes {Number} The number of bytes to allocate. options.time {Number} The amount of time, in milliseconds, to take to allocate the memory. options.increments {Number} The number of allocations to perform. The timespan will be divided into even increments and one allocation will occur per increment. options.debug {Boolean} Whether or not to print debug messages to console when running. callback {Function} Called when done. Includes the buffers that were allocated.

Examples

// Bleed 1 gigabyte of memory over 60 seconds. One allocation per second.
var options = {
  bytes = bleed.ONE_GIGABYTE;
  time = 60000;
  increments = 60;
};

bleed(options, function(err, buffers) { console.log('DONE!') });
// Bleed 50 megabytes of memory.
var options = {
  bytes = bleed.ONE_MEGABYTE * 50;
};

bleed(options, function(err, buffers) { console.log('DONE!') });
// Bleed 2 gigabytes of data over 30 seconds. One allocation very 2 seconds.
var options = {
  bytes = 2 * bleed.ONE_GIGABYTE;
  time = 30000;
  increments = 15;
};

bleed(options, function(err, buffers) { console.log('DONE!') });

Keywords

FAQs

Package last updated on 25 Aug 2014

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