peakmem.Rd
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.
peakmem(file, timeout = Inf)
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. |
Maximum memory used in GB