detkit.Memory.info#
- static Memory.info()#
Inquiry memory information.
- Returns:
- mem_info
An object containing the following attributes:
'total'
: total memory in bytes'available'
: available memory in bytes'used'
: used memory in bytes'free'
: free memory in bytes'inactive'
: inactive memory in bytes'buffer'
: buffer memory in bytes'cached'
: cached memory in bytes'shared'
: shared memory in bytes'percent'
: percent of one minus available over total memory'slab'
: slab memory in bytes
Examples
>>> from detkit import Memory, human_readable_mem >>> mem_info = Memory.info() >>> # total memory >>> print(human_readable_mem(mem_info.total)) 15.6 (GB) >>> # used memory >>> print(human_readable_mem(mem_info.used)) 4.28 (GB) >>> # available memory >>> print(human_readable_mem(mem_info.available)) 9.24 (GB)