Learn R Programming

pryr (version 0.1.6)

mem_change: Determine change in memory from running code

Description

Determine change in memory from running code

Usage

mem_change(code)

Value

Change in memory (in megabytes) before and after running code.

Arguments

code

Code to evaluate.

Examples

Run this code
# Need about 4 mb to store 1 million integers
mem_change(x <- 1:1e6)
# We get that memory back when we delete it
mem_change(rm(x))

Run the code above in your browser using DataLab