mlx.core.set_memory_limit#
- set_memory_limit(limit: int) int #
Set the memory limit.
The memory limit is a guideline for the maximum amount of memory to use during graph evaluation. If the memory limit is exceeded and there is no more RAM (including swap when available) allocations will result in an exception.
When metal is available the memory limit defaults to 1.5 times the maximum recommended working set size reported by the device.