Analyzer process-memory

Name

process-memory - Virtual Memory Usage Breakdown

This analyzer profiles virtual memory usage breakdown for a specific process. It captures detailed memory metrics including resident set size (RSS), virtual memory size, shared memory, file-backed memory, anonymous memory, and swap usage. The analyzer generates pie charts that visualize the distribution of different memory types, helping identify memory consumption patterns and potential memory leaks or inefficient memory usage in the target process.

Resource Category

Memory.

Application Type & Technical Stack

  • All

Command Line Syntax

The analyzer can be invoked directly on the command-line via the orxray utility from the openresty-xray-cli software package.

Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).

# PID is the target process PID.
orxray analyzer run process-memory -p PID

# trace a shell command directly
orxray analyzer run process-memory -c SHELL_CMD

Tracing Multiple Processes

Not supported.

Output Formats

  • Pie Charts
  • Plain Texts

Output Example

{
  "vm_rss": 1256439808,        // Resident Set Size: physical memory actually used
  "vm_size": 7154098176,       // Virtual Memory Size: total virtual address space allocated
  "rss_shmem": 0,              // Shared memory portion of RSS
  "vm_swap": 0,                // Memory swapped to disk
  "rss_file": 27353088,        // File-backed memory (e.g., memory-mapped files)
  "rss_anon": 1229086720       // Anonymous memory (heap, stack, not backed by files)
}

Author

The OpenResty Inc. Team.

Copyright (C) by OpenResty Inc. All rights reserved.