pub struct LinuxMemory { /* private fields */ }Expand description
LinuxMemory for Linux cgroup ‘memory’ resource management.
Implementations§
Source§impl LinuxMemory
impl LinuxMemory
Sourcepub fn reservation(&self) -> Option<i64>
pub fn reservation(&self) -> Option<i64>
Memory reservation or soft_limit (in bytes).
Sourcepub fn kernel(&self) -> Option<i64>
pub fn kernel(&self) -> Option<i64>
Kernel memory limit (in bytes).
§Deprecated
kernel-memory limits are not supported in cgroups v2, and were obsoleted in kernel v5.4.
Sourcepub fn kernel_tcp(&self) -> Option<i64>
pub fn kernel_tcp(&self) -> Option<i64>
Kernel memory limit for tcp (in bytes).
Sourcepub fn swappiness(&self) -> Option<u64>
pub fn swappiness(&self) -> Option<u64>
How aggressive the kernel will swap memory pages.
Sourcepub fn disable_oom_killer(&self) -> Option<bool>
pub fn disable_oom_killer(&self) -> Option<bool>
DisableOOMKiller disables the OOM killer for out of memory conditions.
Sourcepub fn use_hierarchy(&self) -> Option<bool>
pub fn use_hierarchy(&self) -> Option<bool>
Enables hierarchical memory accounting
Sourcepub fn check_before_update(&self) -> Option<bool>
pub fn check_before_update(&self) -> Option<bool>
Enables checking if a new memory limit is lower
Source§impl LinuxMemory
impl LinuxMemory
Sourcepub fn set_reservation(&mut self, val: Option<i64>) -> &mut Self
pub fn set_reservation(&mut self, val: Option<i64>) -> &mut Self
Memory reservation or soft_limit (in bytes).
Sourcepub fn set_kernel(&mut self, val: Option<i64>) -> &mut Self
pub fn set_kernel(&mut self, val: Option<i64>) -> &mut Self
Kernel memory limit (in bytes).
§Deprecated
kernel-memory limits are not supported in cgroups v2, and were obsoleted in kernel v5.4.
Sourcepub fn set_kernel_tcp(&mut self, val: Option<i64>) -> &mut Self
pub fn set_kernel_tcp(&mut self, val: Option<i64>) -> &mut Self
Kernel memory limit for tcp (in bytes).
Sourcepub fn set_swappiness(&mut self, val: Option<u64>) -> &mut Self
pub fn set_swappiness(&mut self, val: Option<u64>) -> &mut Self
How aggressive the kernel will swap memory pages.
Sourcepub fn set_disable_oom_killer(&mut self, val: Option<bool>) -> &mut Self
pub fn set_disable_oom_killer(&mut self, val: Option<bool>) -> &mut Self
DisableOOMKiller disables the OOM killer for out of memory conditions.
Sourcepub fn set_use_hierarchy(&mut self, val: Option<bool>) -> &mut Self
pub fn set_use_hierarchy(&mut self, val: Option<bool>) -> &mut Self
Enables hierarchical memory accounting
Sourcepub fn set_check_before_update(&mut self, val: Option<bool>) -> &mut Self
pub fn set_check_before_update(&mut self, val: Option<bool>) -> &mut Self
Enables checking if a new memory limit is lower
Trait Implementations§
Source§impl Clone for LinuxMemory
impl Clone for LinuxMemory
Source§fn clone(&self) -> LinuxMemory
fn clone(&self) -> LinuxMemory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LinuxMemory
impl Debug for LinuxMemory
Source§impl Default for LinuxMemory
impl Default for LinuxMemory
Source§fn default() -> LinuxMemory
fn default() -> LinuxMemory
Source§impl<'de> Deserialize<'de> for LinuxMemory
impl<'de> Deserialize<'de> for LinuxMemory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LinuxMemory
impl PartialEq for LinuxMemory
Source§fn eq(&self, other: &LinuxMemory) -> bool
fn eq(&self, other: &LinuxMemory) -> bool
self and other values to be equal, and is used by ==.