R: Memory usage information

ps_memory_info {ps} | R Documentation

## Memory usage information

### Description

A list with information about memory usage. Portable fields:

- `rss`: "Resident Set Size", this is the non-swapped physical memory a process has used. On UNIX it matches "top"‘s 'RES' column (see doc). On Windows this is an alias for `wset` field and it matches "Memory" column of `taskmgr.exe`.

- `vmem`: "Virtual Memory Size", this is the total amount of virtual memory used by the process. On UNIX it matches "top"‘s 'VIRT' column (see doc). On Windows this is an alias for the `pagefile` field and it matches the "Working set (memory)" column of `taskmgr.exe`.

### Usage

    ps_memory_info(p = ps_handle())

### Arguments

`p` | Process handle.

### Details

Non-portable fields:

- `shared`: (Linux) memory that could be potentially shared with other processes. This matches "top"‘s 'SHR' column (see doc).

- `text`: (Linux): aka 'TRS' (text resident set) the amount of memory devoted to executable code. This matches "top"‘s 'CODE' column (see doc).

- `data`: (Linux): aka 'DRS' (data resident set) the amount of physical memory devoted to other than executable code. It matches "top"‘s 'DATA' column (see doc).

- `lib`: (Linux): the memory used by shared libraries.

- `dirty`: (Linux): the number of dirty pages.

- `pfaults`: (macOS): number of page faults.

- `pageins`: (macOS): number of actual pageins.

For on explanation of Windows fields see the PROCESS_MEMORY_COUNTERS_EX structure.

Throws a `zombie_process()` error for zombie processes.

### Value

Named real vector.

### See Also

Other process handle functions: `ps_children()`, `ps_cmdline()`, `ps_connections()`, `ps_cpu_times()`, `ps_create_time()`, `ps_cwd()`, `ps_descent()`, `ps_environ()`, `ps_exe()`, `ps_handle()`, `ps_interrupt()`, `ps_is_running()`, `ps_kill()`, `ps_name()`, `ps_num_fds()`, `ps_num_threads()`, `ps_open_files()`, `ps_pid()`, `ps_ppid()`, `ps_resume()`, `ps_send_signal()`, `ps_shared_libs()`, `ps_status()`, `ps_suspend()`, `ps_terminal()`, `ps_terminate()`, `ps_uids()`, `ps_username()`

### Examples

    p <- ps_handle()
    p
    ps_memory_info(p)

[Package ps version 1.5.0 Index]