fed135/ha-store

In-memory store should watch for memory limits

Closed this issue · 0 comments

// Limit memory for the process (takes in account the --max_old_space_size flag)
const limit = require('v8').getHeapStatistics().total_available_size / 1024 / 1024

// Current RSS
const current = process.memoryUsage().rss / 1024 / 1024;

Could add a new store option to limit memory (%) of total_available_size. After which, no new records can be saved.