mem_used2: How much memory is presently/maximally used by R?

View source: R/mem_used2.R

mem_used2R Documentation

How much memory is presently/maximally used by R?

Description

This function is inspired by pryr::mem_used function.

Usage

mem_used2(maximum = FALSE)

Arguments

maximum

locical, whether to show the maximum memory that R used. Default is FALSE, which means the memory that R currently used.

Examples

## Not run: 
mem_use2()
mem_use2(TRUE)

x = matrix(1.2, nrow = 10000, ncol = 1000)
mem_used2()
mem_used2(TRUE)

# After removing x, current memory recover but the maximum memory does not.
rm(x)
mem_used2()
mem_used2(TRUE)

## End(Not run)

paodan/funcTools documentation built on April 1, 2024, 12:01 a.m.