MLX and Ollama memory limits tested on a 16 GiB Mac mini
丘山录 tested Ollama v0.40.19 and MLX on a 16 GiB Apple M6 Mac mini. MLX's largest successful contiguous allocation was 7.9557 GiB, while an 8 GiB request raised an int32-boundary OverflowError; Ollama requests succeeded through a 16,384-token context and failed at 20,480 and 24,576. Separate tests showed that the reported 11.84 GiB recommended working set was not a hard limit, with a 15 GiB resident load sustaining about 83 tokens per second.
The measurements distinguish a software allocation boundary, an advisory working-set figure and physical memory, but they apply to one Mac mini configuration and do not identify whether the MLX overflow originates in its Python wrapper or C layer.
Mac mini 16G 跑 Ollama,8 GiB 就崩,剩下全靠换页
结论先行:这台 16 GiB 的 Mac mini 上,第一个把模型卡住的地方是 8 GiB,不是网上到处传的那个 11.84 GiB
这句判断来自一次实测量出来的数:这台 16 GiB 的机型,往上加内存的价差我按公开档位区间估,大概两千块一档。
环境、命令、量出来的数都在下面,可以直接照着重跑。
更难看的是:崩的时候内存还剩一大半,系统根本没在省着用。
验证等级:L3 | OpenAI 兼容接口端到端实测(能确认现象、定位截断值),截断成因只做到「Python 封装层的整型尺寸限制」这一层,MLX 源码未读,已在正文标出