AUTHORS:
Return memory usage.
INPUT:
OUTPUT:
EXAMPLES:
We test that memory usage doesn’t change instantly:
sage: t = get_memory_usage()
sage: get_memory_usage(t) # amount of memory more than when we defined t.
0.0
NOTES:
Return the ‘top’ or ‘prstat’ line that contains this running Sage process.
OUTPUT:
EXAMPLES:
sage: top() # random output
'72373 python 0.0% 0:01.36 1 14+ 1197 39M+ 34M+ 55M+ 130M+'
NOTES:
The external command ‘top’ (http://www.unixtop.org/) is called on Linux, and most other operating systems. The output format of ‘top’ is not consistent across all platforms and all versions of ‘top’. If the top() function does not work in Sage, you may need to install ‘top’.
The external command ‘prstat’ is called on the Solaris and OpenSolaris systems. That is part of Solaris, and will not need to be installed. The columns used in the ‘prstat’ output are:
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP