public subroutine tem_trackmem(memfile, iteration)
Write the current memory status into the memfile.
The file will be opened and closed, so this might be slow.
Only the root process writes to this file, but the data is gathered from
The output will be prepended by the current date.
We will track the VmHWM: from /proc/self/status,
MemFree:, Buffers: and Cached: from /proc/meminfo
and pgmajfault from /proc/vmstat
The min, max and average across all processes will be recorded.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.