[−][src]Struct cgroups_rs::memory::MemController
A controller that allows controlling the memory
subsystem of a Cgroup.
In essence, using the memory controller, the user can gather statistics about the memory usage of the tasks in the control group. Additonally, one can also set powerful limits on their memory usage.
Implementations
impl MemController
[src]
pub fn new(root: PathBuf, v2: bool) -> Self
[src]
Contructs a new MemController
with root
serving as the root of the control group.
pub fn set_mem(&self, m: SetMemory) -> Result<()>
[src]
pub fn get_mem(&self) -> Result<SetMemory>
[src]
pub fn memory_stat(&self) -> Memory
[src]
Gathers overall statistics (and the current state of) about the memory usage of the control group's tasks.
See the individual fields for more explanation, and as always, remember to consult the kernel Documentation and/or sources.
pub fn kmem_stat(&self) -> Kmem
[src]
Gathers information about the kernel memory usage of the control group's tasks.
pub fn kmem_tcp_stat(&self) -> Tcp
[src]
Gathers information about the control group's kernel memory usage where said memory is TCP-related.
pub fn memswap_v2(&self) -> MemSwap
[src]
pub fn memswap(&self) -> MemSwap
[src]
Gathers information about the memory usage of the control group including the swap usage (if any).
pub fn reset_fail_count(&self) -> Result<()>
[src]
Reset the fail counter
pub fn reset_kmem_fail_count(&self) -> Result<()>
[src]
Reset the kernel memory fail counter
pub fn reset_tcp_fail_count(&self) -> Result<()>
[src]
Reset the TCP related fail counter
pub fn reset_memswap_fail_count(&self) -> Result<()>
[src]
Reset the memory+swap fail counter
pub fn reset_max_usage(&self) -> Result<()>
[src]
Reset the max memory usage recorded
pub fn set_limit(&self, limit: i64) -> Result<()>
[src]
Set the memory usage limit of the control group, in bytes.
pub fn set_kmem_limit(&self, limit: i64) -> Result<()>
[src]
Set the kernel memory limit of the control group, in bytes.
pub fn set_memswap_limit(&self, limit: i64) -> Result<()>
[src]
Set the memory+swap limit of the control group, in bytes.
pub fn set_tcp_limit(&self, limit: i64) -> Result<()>
[src]
Set how much kernel memory can be used for TCP-related buffers by the control group.
pub fn set_soft_limit(&self, limit: i64) -> Result<()>
[src]
Set the soft limit of the control group, in bytes.
This limit is enforced when the system is nearing OOM conditions. Contrast this with the hard limit, which is always enforced.
pub fn set_swappiness(&self, swp: u64) -> Result<()>
[src]
Set how likely the kernel is to swap out parts of the address space used by the control group.
Note that a value of zero does not imply that the process will not be swapped out.
pub fn disable_oom_killer(&self) -> Result<()>
[src]
pub fn register_oom_event(&self, key: &str) -> Result<Receiver<String>>
[src]
Trait Implementations
impl Clone for MemController
[src]
pub fn clone(&self) -> MemController
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MemController
[src]
impl<'a> From<&'a Subsystem> for &'a MemController
[src]
pub fn from(sub: &'a Subsystem) -> &'a MemController
[src]
Auto Trait Implementations
impl RefUnwindSafe for MemController
[src]
impl Send for MemController
[src]
impl Sync for MemController
[src]
impl Unpin for MemController
[src]
impl UnwindSafe for MemController
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Controller for T where
T: ControllerInternal,
[src]
T: ControllerInternal,
pub fn control_type(&Self) -> Controllers
[src]
pub fn path(&Self) -> &Path
[src]
pub fn apply(&Self, &Resources) -> Result<(), Error>
[src]
Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.
pub fn create(&Self)
[src]
Create this controller
pub fn set_notify_on_release(&Self, bool) -> Result<(), Error>
[src]
Set notify_on_release
pub fn set_release_agent(&Self, &str) -> Result<(), Error>
[src]
Set release_agent
pub fn exists(&Self) -> bool
[src]
Does this controller already exist?
pub fn delete(&Self) -> Result<(), Error>
[src]
Delete the controller.
pub fn add_task(&Self, &CgroupPid) -> Result<(), Error>
[src]
Attach a task to this controller.
pub fn add_task_by_tgid(&Self, &CgroupPid) -> Result<(), Error>
[src]
Attach a task to this controller by thread group id.
pub fn tasks(&Self) -> Vec<CgroupPid, Global>
[src]
Get the list of tasks that this controller has.
pub fn v2(&Self) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,