R: Retrieve the current and maximum memory from the R process

bench_process_memory {bench} | R Documentation

## Retrieve the current and maximum memory from the R process

### Description

The memory reported here will likely differ from that reported by `gc()`, as this includes all memory from the R process, including any child processes and memory allocated outside R's garbage collector heap.

### Usage

    bench_process_memory()

### Details

The OS APIs used are as follows

#### Windows

- PROCESS_MEMORY_COUNTERS.WorkingSetSize

- PROCESS_MEMORY_COUNTERS.PeakWorkingSetSize

#### macOS

- task_info(TASK_BASIC_INFO)

- rusage.ru_maxrss

#### linux

- /proc/pid/status VmSize

- /proc/pid/status VmPeak and on Windows PROCESS_MEMORY_COUNTERS.PeakWorkingSetSize

[Package bench version 1.1.1 Index]