peakmem: Compute peak memory used by a R script

Description Usage Arguments Value

Description

The function runs the script using Rscript program in a different process and uses a python utility 'memusg' (https://github.com/jhclark/memusg/) to measure the peak memory usage by the prcocess and its child processes. This will be helpful in measuring the memory usage of code involving parallel processing. For example, code involving ‘parallel::mclapply' call. Place the ’memusg.py' file in '/usr/local/bin' directory and make it executable. The function is meant to measure peak memory utility in the order of GBs with long running parallel processes. For smaller processes, the overhead itself will distort the real usage. For smaller benchmarks, use 'benck::mark' or 'peakRAM::peakRAM'. For more details, its better to modify the python program.

Usage

1
peakmem(file, timeout = Inf)

Arguments

file

Location of script

timeout

Timeout for the process, in seconds, or as a difftime object. If it is not finished before this, it will be killed.

Value

Maximum memory used in GB


talegari/sidekicks documentation built on May 30, 2019, 8:40 a.m.