Crate kumo_server_memory

Source
Expand description

This module contains logic to reason about memory usage, implement memory limits, and some helpers to attempt to release cached memory back to the system when memory is low.

Re-exports§

pub use tracking::set_tracking_callstacks;
pub use tracking::tracking_stats;

Modules§

tracking

Structs§

JemallocStats
MemoryLimits
Represents a constraint on memory usage
MemoryUsage
Represents the current memory usage of this process
NumBytes
Number

Enums§

MemoryStatus

Functions§

get_headroom
Returns the amount of headroom; the number of bytes that can be allocated before we hit the soft limit
get_usage_and_limit
low_memory
Returns true when we are within 10% if the soft limit
memory_status
Indicates the overall memory status
purge_thread_cache
To be called when a thread goes idle; it will flush cached memory out of the thread local cache to be returned/reused elsewhere in the system
set_hard_limit
set_low_memory_thresh
set_soft_limit
setup_memory_limit
Initialize the memory thread to monitor memory usage/limits
subscribe_to_memory_status_changes
Returns a receiver that will notify when memory status changes from OK -> !OK or vice versa.
subscribe_to_memory_status_changes_async