pub struct MemoryStats {
pub active: usize,
pub peak: usize,
pub cache: usize,
pub memory_limit: usize,
pub cache_limit: usize,
pub system_allocations: u64,
pub wired_limit: usize,
pub wired: usize,
pub mapped: usize,
pub wired_mapped: usize,
}Expand description
Memory use and limits of a device’s allocator, in bytes.
Fields§
§active: usizeBytes in live buffers (rounded allocation sizes).
peak: usizeHighest active since creation or the last Device::reset_peak.
cache: usizeBytes held in the cache for reuse.
memory_limit: usizeAllocations that would push active past this fail.
cache_limit: usizeThe cache is trimmed to at most this many bytes.
system_allocations: u64Buffers obtained from Metal (cache misses) so far.
wired_limit: usizeBuffers are kept resident up to this many bytes (see
Device::set_wired_limit).
wired: usizeBytes currently wired, including wired_mapped.
mapped: usizeBytes of live memory-mapped files (checkpoints loaded without a copy). They are not
in active or peak, which count the allocator’s own buffers only; MLX copies
weights into its allocator, so its active includes them.
wired_mapped: usizeThe part of wired that belongs to memory-mapped files.
Trait Implementations§
Source§impl Clone for MemoryStats
impl Clone for MemoryStats
impl Copy for MemoryStats
Source§impl Debug for MemoryStats
impl Debug for MemoryStats
impl Eq for MemoryStats
Source§impl PartialEq for MemoryStats
impl PartialEq for MemoryStats
impl StructuralPartialEq for MemoryStats
Auto Trait Implementations§
impl Freeze for MemoryStats
impl RefUnwindSafe for MemoryStats
impl Send for MemoryStats
impl Sync for MemoryStats
impl Unpin for MemoryStats
impl UnsafeUnpin for MemoryStats
impl UnwindSafe for MemoryStats
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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