Skip to main content

Module memory

Module memory 

Source
Expand description

Process-global MLX allocator controls and observations.

The state exposed here affects every thread and every evaluation in the process. These functions do not synchronize a sequence of reads and writes for callers.

Functions§

active_memory
Return the number of bytes in active use by MLX.
cache_memory
Return the number of bytes held in MLX’s allocator cache.
clear_cache
Clear cached allocator buffers.
memory_limit
Return the process-global memory limit in bytes.
peak_memory
Return the peak number of bytes used by MLX.
reset_peak_memory
Reset the process-global peak-memory counter for all threads and evaluations.
set_cache_limit
Set the process-global allocator-cache limit in bytes and return its previous value.
set_memory_limit
Set the process-global memory limit in bytes and return its previous value.
set_wired_limit
Set the process-global wired-memory limit in bytes and return its previous value.