Skip to content

Memory metrics

By monitoring memory usage metrics, you can understand how memory resources are being used. This, in turn, can provide insights into areas that may need optimization or adjustment.

memory and os.stat

Tags: appclass, host, identity, instance_id, node_id, service_id, tenant

VmPeak

Meaning: Peak virtual memory size. This is the peak or current total of virtual memory being used by the microservice. Virtual memory includes both physical RAM and disk swap space (the sum of all virtual memory areas involved in the process).

Interpretation: Monitoring the peak can help you identify if a service is using more memory than expected, potentially indicating a memory leak or a requirement for optimization.

VmLck

Meaning: Locked memory size. This indicates the portion of memory that is locked in RAM and can't be swapped out to disk.

Interpretation: A high amount of locked memory could potentially reduce the system's flexibility in managing memory, which might lead to performance issues.

VmPin

Meaning: Pinned memory size. This is the portion of memory that is "pinned" in place; a memory page's physical location can't be changed within RAM automatically or swapped out to disk.

Interpretation: Like locked memory, pinned memory can't be moved, so a high value could also limit system flexibility.

VmHWM

Meaning: Peak resident set size ("high water mark"). This is the maximum amount of physical RAM that the microservice has used.

Interpretation: If this value is consistently high, it might indicate that the service needs optimization or that you need to allocate more physical RAM.

VmRSS

Meaning: Resident set size. This shows the portion of the microservice's memory that is held in RAM.

Interpretation: A high RSS value could mean your service is using a lot of RAM, potentially leading to performance issues if it starts to swap.

VmData, VmStk, VmExe

Meaning: Size of data, stack, and text segments. These values represent the sizes of different memory segments: data, stack, and executable code.

Interpretation: Monitoring these can help you understand the memory footprint of your service and can be useful for debugging or optimizing your code.

VmLib

Meaning: Shared library code size. This counts executable pages with a VmExe subtracted, and shows the amount of memory used by shared libraries in the process.

Interpretation: If this is high, you may want to check whether all the libraries are necessary, as they add to the memory footprint.

VmPTE

Meaning: Page table entries size. This indicates the size of the page table, which maps virtual memory to physical memory.

Interpretation: A large size might signify that a lot of memory is being used, which could be an issue if it grows too much.

VmSize

Meaning: Size of second-level page tables. This is an extension of VmPTE, indicating the size of the second-level page tables.

Interpretation: Like VmPTE, monitoring this size helps in identifying potential memory issues.

VmSwap

Meaning: Swapped-out virtual memory size. This indicates the amount of virtual memory that has been swapped out to disk. shmem swap is not included.

Interpretation: Frequent swapping is generally bad for performance; thus, if this metric is high, you may need to allocate more RAM or optimize your services.

mem

Additional masurements regarding memory. Visit the InfluxDB Telegraf plugin documentation for details.

  • Tags: node_id

  • active: Memory currently in use or very recently used, and thus not immediately available for eviction.

  • available: The amount of memory that is readily available for new processes without swapping.
  • available_percent: The percentage of total memory that is readily available for new processes.
  • buffered: Memory used by the kernel for things like file system metadata, distinct from caching.
  • cached: Memory used to store recently used data for quick access, not immediately freed when processes no longer require it.
  • commit_limit: The total amount of memory that can be allocated to processes, including both RAM and swap space.
  • committed_as: The total amount of memory currently allocated by processes, even if not used.
  • dirty: Memory pages that have been modified but not yet written to their respective data location in storage.
  • free: The amount of memory that is currently unoccupied and available for use.
  • high_free: The amount of free memory in the system's high memory area (memory beyond direct kernel access).
  • high_total: The total amount of system memory in the high memory area.
  • huge_page_size: The size of each huge page (larger-than-standard memory pages used by the system).
  • huge_pages_free: The number of huge pages that are not currently being used.
  • huge_pages_total: The total number of huge pages available in the system.
  • inactive: Memory that has not been used recently and can be made available for other processes or disk caching.
  • low_free: The amount of free memory in the system's low memory area (memory directly accessible by the kernel).
  • low_total: The total amount of system memory in the low memory area.
  • mapped: Memory used for mapped files, such as libraries and executable files in memory.
  • page_tables: Memory used by the kernel to keep track of virtual memory to physical memory mappings.
  • shared: Memory used by multiple processes, or shared between processes and the kernel.
  • slab: Memory used by the kernel for caching data structures.
  • sreclaimable: Part of the slab memory that can be reclaimed, such as caches that can be freed if necessary.
  • sunreclaim: Part of the slab memory that cannot be reclaimed under memory pressure.
  • swap_cached: Memory that has been swapped out to disk but is still in RAM.
  • swap_free: The amount of swap space currently not being used.
  • swap_total: The total amount of swap space available.
  • total: The total amount of physical RAM available in the system.
  • used: The amount of memory that is currently being used by processes.
  • used_percent: The percentage of total memory that is currently being used.
  • vmalloc_chunk: The largest contiguous block of memory available in the kernel's vmalloc space.
  • vmalloc_total: The total amount of memory available in the kernel's vmalloc space.
  • vmalloc_used: The amount of memory currently used in the kernel's vmalloc space.
  • write_back: Memory which is currently being written back to the disk.
  • write_back_tmp: Temporary memory used during write-back operations.