Limit memory usage

Hypertest provides an inbuilt way to limit your memory usage to avoid using too much memory. You can provide us a config to limit the memory usage that looks like this.

htSdk.setMemoryUsageLimiterConfig({
  memoryUsageUpperThresholdMB: 500, // megabytes
  memoryUsageLowerThresholdMB: 400, // megabytes
  memoryCheckIntervalMs: 10, // Milliseconds
});

memoryUsageUpperThresholdMB is the upper bound for memory. Hypertest will get disabled if your memory consumption goes above this value.

memoryUsageLowerThresholdMB is the lower bound for memory. Hypertest will get enabled if your memory consumption goes below this value.

memoryCheckIntervalMs is the value in milliseconds. Hypertest calls the process.memoryUsage API periodically with an interval of this value.

memoryUsageUpperThresholdMB and memoryUsageLowerThresholdMB are required fields whereas memoryCheckIntervalMs has a default value of 10 milliseconds if you don't provide it.

Last updated