tgoop.com/PyLab/324
Create:
Last Update:
Last Update:
#آموزش #psutil
چه قدر حافظه فیزکی داریم؟ تا چه مقدار اگر حافظه استفاده کنیم سیستم از swap استفاده نمیکنه؟ و اطلاعات آماری مفید دیگر از حافظه RAM با psutil در پایتون.
import psutil ; print(list(psutil.virtual_memory()))Return statistics about system memory usage as a namedtuple
including the following fields, expressed in bytes:
- total:
total physical memory available.
- available:
the memory that can be given instantly to processes without the
system going into swap.
This is calculated by summing different memory values depending
on the platform and it is supposed to be used to monitor actual
memory usage in a cross platform fashion.
- percent:
the percentage usage calculated as (total - available) / total * 100
- used:
memory used, calculated differently depending on the platform and
designed for informational purposes only:
macOS: active + inactive + wired
BSD: active + wired + cached
Linux: total - free
- free:
memory not being used at all (zeroed) that is readily available;
note that this doesn't reflect the actual memory available
(use 'available' instead)
https://www.tgoop.com/PyLab/325
BY Python_Labs🐍

Share with your friend now:
tgoop.com/PyLab/324