synapse.lib.platforms package
Home for platform specific code such as thishost info.
all platform modules must be importable from any platform.
( guard any platform specific code with appropriate conditionals )
Submodules
synapse.lib.platforms.common module
- synapse.lib.platforms.common.daemonize()[source]
For unix platforms, form a new process group using fork().
synapse.lib.platforms.darwin module
synapse.lib.platforms.freebsd module
synapse.lib.platforms.linux module
- synapse.lib.platforms.linux.getAvailableMemory()[source]
Returns the available memory of the system
- synapse.lib.platforms.linux.getCurrentLockedMemory()[source]
Return the amount of memory this process has locked
- synapse.lib.platforms.linux.getFileMappedRegion(filename)[source]
Return a tuple of address and length of a particular file memory mapped into this process
- synapse.lib.platforms.linux.getMaxLockedMemory()[source]
Returns the maximum amount of memory this process can lock
- synapse.lib.platforms.linux.getTotalMemory()[source]
Get the total amount of memory in the system.
Notes
This attempts to get information from cgroup data before falling back to
/proc/meminfo
data.- Returns:
The number of bytes of memory available in the system.
- Return type:
int
- synapse.lib.platforms.linux.maximizeMaxLockedMemory()[source]
Remove any discretionary (i.e. soft) limits
- synapse.lib.platforms.linux.mlock(address, length)[source]
Lock a chunk of memory to prevent it from being swapped out, raising an OSError on error