AUTHORS:
Function used internally by this module.
Return memory usage.
INPUT:
OUTPUT:
EXAMPLES:
sage: t = get_memory_usage(); t # random
873.98046875
We test that memory usage doesn’t change instantly. Hopefully,
re-using the variable means no additional memory will be
allocated:
sage: t = get_memory_usage()
sage: get_memory_usage(t)
0.0
Note
Return memory usage in megabytes.
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