bronx.system.memory

This module is in charge of getting informations on Memory.

Various concrete implementations may be provided since the mechanism to retrieve information on Memory may not be portable across platforms. At the present time, the only concrete implementation is the LinuxMemInfo.

Functions

bronx.system.memory.convert_bytes_in_unit(mem_b, unit)[source]

Convert bytes to unit (among KB, MB, GB, … or KiB, MiB, GiB).

Note: KB, MB, … are powers of 1000 whereas KiB, MiB, … are powers of 1024 (KiB are often mistaken for KB).

Classes

class bronx.system.memory.LinuxMemInfo[source]

Bases: MemInfo

Provide various informations about Memory.

children_maxRSS(unit='MiB')[source]

Get Maximum Resident Set Size (i.e. maximum memory used at one moment) of the process children.

process_maxRSS(unit='MiB')[source]

Get Maximum Resident Set Size (i.e. maximum memory used at one moment) used by of the process.

class bronx.system.memory.MemInfo[source]

Bases: object

Provide various informations about Memory (abstract class).

abstract children_maxRSS(unit='MiB')[source]

Get Maximum Resident Set Size (i.e. maximum memory used at one moment) of the process children.

abstract process_maxRSS(unit='MiB')[source]

Get Maximum Resident Set Size (i.e. maximum memory used at one moment) used by of the process.

system_RAM(unit='MiB')[source]

Get total RAM memory available in the system.

Exceptions

exception bronx.system.memory.MemToolUnavailableError[source]

Bases: Exception

Raised whenever the necessary commands and/or system files are missing.