Here's an example of the output of the script on my system: % memReport.py The script also counts up the "real memory" usage of all running processes for comparison (this won't match any specific value(s) from overall memory stats, because memory is a complex beast). Print('Real Mem Total (ps):\t%.3f MB' % (rssTotal/1024/1024))Īs you can see, you can just call vm_stat from the command line, though it counts in 4kB pages, hence the script to convert to MB. Vm = subprocess.Popen(, stdout=subprocess.PIPE).communicate().decode() Ps = subprocess.Popen(, stdout=subprocess.PIPE).communicate().decode() If you want it on the command line, here is a Python script that I wrote (or perhaps modified from someone else's, I can't remember, it's quite old now) to show you the Wired, Active, Inactive and Free memory amounts: #!/usr/bin/python As says, you can see this info in Activity Monitor.
0 Comments
Leave a Reply. |