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§
Structs§
- Jemalloc
Stats - Memory
Limits - Represents a constraint on memory usage
- Memory
Usage - Represents the current memory usage of this process
- NumBytes
- Number
Enums§
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