pub struct MemoryResources {
pub kernel_memory_limit: Option<i64>,
pub memory_hard_limit: Option<i64>,
pub memory_soft_limit: Option<i64>,
pub kernel_tcp_memory_limit: Option<i64>,
pub memory_swap_limit: Option<i64>,
pub swappiness: Option<u64>,
pub attrs: HashMap<String, String>,
}
Expand description
Resource limits for the memory subsystem.
Fields§
§kernel_memory_limit: Option<i64>
How much memory (in bytes) can the kernel consume.
memory_hard_limit: Option<i64>
Upper limit of memory usage of the control group’s tasks.
memory_soft_limit: Option<i64>
How much memory the tasks in the control group can use when the system is under memory pressure.
kernel_tcp_memory_limit: Option<i64>
How much of the kernel’s memory (in bytes) can be used for TCP-related buffers.
memory_swap_limit: Option<i64>
How much memory and swap together can the tasks in the control group use.
swappiness: Option<u64>
Controls the tendency of the kernel to swap out parts of the address space of the tasks to disk. Lower value implies less likely.
Note, however, that a value of zero does not mean the process is never swapped out. Use the
traditional mlock(2)
system call for that purpose.
attrs: HashMap<String, String>
Customized key-value attributes
§Usage:
let resource = &mut cgroups_rs::Resources::default();
resource.memory.attrs.insert("memory.numa_balancing".to_string(), "true".to_string());
// apply here
Trait Implementations§
Source§impl Clone for MemoryResources
impl Clone for MemoryResources
Source§fn clone(&self) -> MemoryResources
fn clone(&self) -> MemoryResources
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MemoryResources
impl Debug for MemoryResources
Source§impl Default for MemoryResources
impl Default for MemoryResources
Source§fn default() -> MemoryResources
fn default() -> MemoryResources
Returns the “default value” for a type. Read more
Source§impl PartialEq for MemoryResources
impl PartialEq for MemoryResources
impl Eq for MemoryResources
impl StructuralPartialEq for MemoryResources
Auto Trait Implementations§
impl Freeze for MemoryResources
impl RefUnwindSafe for MemoryResources
impl Send for MemoryResources
impl Sync for MemoryResources
impl Unpin for MemoryResources
impl UnwindSafe for MemoryResources
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more