/memory

/api/memory

Overview

The /api/memory endpoint returns the current memory usage of the system in the form of a JSON response.

Endpoint

GET /api/memory

Example

fetch('/api/memory')
  .then(response => response.json())
  .then(data => {
    console.log(`Memory Usage: ${data.memoryUsage}%`);
  });

Response

The response will return a JSON object containing the memoryUsage value:

{
  "memoryUsage": "72.35"
}

Description

  • /api/memory provides the current memory usage as a percentage of active memory.

  • It uses the getMemoryUsage() function internally to fetch the data.

  • The result is returned as a floating-point number with two decimal places, representing the percentage of memory used.

Last updated