Hypertest v2 Docs
HyperTest
  • Overview
    • How It Works?
  • SETUP GUIDE
    • Installation
      • Deploy HyperTest Server
      • Creating your first User
      • Adding your first service
      • Integrate SDK
        • Node.js
          • Node.js SDK with CJS
          • Node.js SDK with ESM
        • Java
    • Start a Test Run
      • CLI Login
      • Type References
      • Java
  • Interpreting Test Results
    • Test Results
    • Understanding Results Categories
    • Mock Not Found
    • AI Match Mocks
    • Accepting Changes
  • USER GUIDES
    • Node.js SDK
      • Limit memory usage
      • Supported NPM packages
      • Mock Dependencies Manually
      • Unmocking/Passing Through
      • Sampling and blocking requests
      • Manage Global Variables
      • Mocking Environment Variables
      • Tags
      • Set HTTP path patterns
      • Discard a test case(Request) while recording
      • Set Git Commit Hash
      • Code coverage based features
        • Continuous Coverage
        • Updating test coverage
        • Running post test deduplication
        • Only testing modified requests
        • Ignore differences for unmodified requests
      • Experimental flags
      • Manual Request
      • Only testing modified requests
      • Server hooks
    • Java SDK
      • Sampling and blocking requests
      • Mock Dependencies Manually
      • Tags
      • Unmocking/Passing Through
      • Code Coverage Setup and Report Generation
      • Supported Java packages
    • Build your own Docker Image
    • CLI Config
    • Ignoring Differences
      • Type References for Filter functions
  • Impact Features
    • Fast Mode
    • Code Coverage Report
    • Delete Recorded Requests
    • Inter Service Testing
  • Release History
    • Slack Integration
    • Version History
Powered by GitBook
On this page
  1. USER GUIDES
  2. Node.js SDK

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.

PreviousNode.js SDKNextSupported NPM packages

Last updated 8 months ago