Library made just to consume memory.
- Testing high memory usage cases.
- Consume memory.
Basic usage:
--max-old-space-size property is probable needed
const MemoryConsumer = require('memory-consumer');
const consumer = new MemoryConsumer();
consumer.fillMemoryMb(500); //consume approx 500mb
consumer.fillMemoryMb(1024); //consume approx 1gb
const MemoryConsumer = require('memory-consumer');
const consumer = new MemoryConsumer(true);
consumer.fillMemoryMb(500); //consume approx 500mb
consumer.fillMemoryMb(1024); //consume approx 1gb
MemoryConsumer(Boolean logsEnabled, Integer logInterbalMs)
consume number of MB.
just enable logs .
just disable logs.
set the iterval miliseconds for logs.
clean the memory storage. (it could take some time until the garbage collector really cleans the memory)
returns used memory string