mem.usage: Measure the resident memory usage of a process.
Description
Returns the memory usage in KB of a process with the specified process id. By
default, returns the memory usage of the current R process. This can be used
to measure and log the memory usage of the R process during script execution.