Learn R Programming

memuse (version 4.2-3)

procmem: procmem

Description

Shows the amount of ram used by the current R process.

Usage

Sys.procmem(gcFirst = TRUE)

Value

Returns a list, whose values are platform dependent in addition to being modified by input arguments.

Arguments

gcFirst

logical; determines if garbage collection should be called before getting process memory usage.

Details

Sys.procmem() returns the total memory usage of the current R process, and (if supported), the maximum memory usage as well.

All of the C-level source code for these methods (in src/meminfo of the root directory of the memuse source tree) is licensed under the permissive 2-Clause BSD license.

See Also

meminfo

Examples

Run this code
if (FALSE) {
library(memuse)

### How much is being used?
Sys.procmem()

### Use more.
x <- rnorm(1e7)
Sys.procmem()

### Use less.
rm(x)
gc(FALSE)
Sys.procmem()
}

Run the code above in your browser using DataLab