@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
});
const backgroundMemoryAttack = createBackgroundMemoryAttack();
backgroundMemoryAttack.start();
backgroundMemoryAttack.stop();
Progressive memory attack.
import BackgroundMemoryAttack from '@dazn/chaos-squirrel-attack-memory-background';
const createBackgroundMemoryAttack = BackgroundMemoryAttack.configure({
size: 2e9
stepSize: 2e8,
stepTime: 1e3
});
const backgroundMemoryAttack = createBackgroundMemoryAttack();
backgroundMemoryAttack.start();
backgroundMemoryAttack.stop();