npm

@dazn/chaos-squirrel-attack-memory-background
TypeScript icon, indicating that this package has built-in type declarations

0.10.1 • Public • Published

@dazn/chaos-squirrel-attack-memory-background

Use lots of memory in a forked process. This will apply memory pressure to your service, without impacting garbage collection or risking the process being killed.

Usage

Basic memory attack.

import BackgroundMemoryAttack from '@dazn/chaos-squirrel-attack-memory-background';

const createBackgroundMemoryAttack = BackgroundMemoryAttack.configure({
  size: 2e9 // ~2gb
});

const backgroundMemoryAttack = createBackgroundMemoryAttack();
backgroundMemoryAttack.start();

// ~2gb of memory will be used in a forked process

backgroundMemoryAttack.stop(); // kills the process

Progressive memory attack.

import BackgroundMemoryAttack from '@dazn/chaos-squirrel-attack-memory-background';

const createBackgroundMemoryAttack = BackgroundMemoryAttack.configure({
  size: 2e9 // ~2gb
  stepSize: 2e8, // ~200mb
  stepTime: 1e3 // 1s
});

const backgroundMemoryAttack = createBackgroundMemoryAttack();
backgroundMemoryAttack.start();

// ~2gb of memory will be used in forked processes, starting from 0gb & increasing by ~200mb every 1s

backgroundMemoryAttack.stop(); // kills the processes

Readme

Keywords

none

Package Sidebar

Install

npm i @dazn/chaos-squirrel-attack-memory-background

Weekly Downloads

18

Version

0.10.1

License

MIT

Unpacked Size

9.16 kB

Total Files

8

Last publish

Collaborators

  • gideonparanoid
  • davidrv87
  • gabriela_nowicka
  • dazn.builder.frontend
  • automation-drone
  • m.bazalik
  • dazn.oss.lambda.powertools