Comment by inventor7777
20 hours ago
I see all the comments about how Windows and Linux handle OOM, but I suppose I'll also mention macOS.
On my M4 Max Mac Studio if I try to load too big of an AI model with protections off, the desktop starts glitching back and forth between the past few hundred frames. It looks bad when it happens but CtrlC still works to kill llama.cpp and if you were using LM Studio, SSH also works. Once you kill the offending process, or if macOS does it for you, the desktop comes back immediately.
Heh, is it cause the integrated graphics is out of memory? Cause it's unified.
Oh, I never thought of that! That would be kind of funny if true.
On my M4 Max MacBook Pro, if I run or even load an LLM more than a couple times, even a small one, general desktop performance starts to get really, really bad until a reboot and I don't know why.
Genuinely, everything starts feeling super sluggish, even long after the process has terminated -- cmd+tab gets slow, apps constantly hang for a few seconds at a time, the cursor position starts lagging and videos are slow to pause/play -- and the only way I've found to fix it is to reboot the entire machine. Clearing memory, restarting apps etc. doesn't work.
Don't get me wrong, the performance and QoS system works really well while the model is still in memory, but after a few cycles of loading and unloading, performance just ends up getting bad in general. Doesn't matter if I'm loading it with llama.cpp, MLX, native Metal, if I start using the GPU for machine learning the machine just gets really upset.
This sucks man... macOS is not supposed to need reboots like that, my Intel Mac could run for months on end without slowing down at all and I could push it as hard as I wanted. As far as I can tell, this behavior is new as of either macOS 26 or the 27 beta. Apple really has been betraying their true Unix roots lately.
Same, I loaded a model that should have fit fine in my available memory and macOS progressively got more broken in the weirdest ways, like my AirPods connecting but being unresponsive and not being able to be configured. I think it started killing internal processes that failed to come back.
Oh wow, you might've just explained some symptoms I've run into a few times. Thanks for your comment.
Wow! That is wild.
I am on 15.7.9 and I have had uptimes in the high 50s with weekly local model usage, I even tried GLM5.2 streaming from SSD and I have not noticed any slowdowns after at all. I guess you are right about 26 and 27. Dang, the more I hear about 26 I am just so glad that I did not update. What version of macOS are you on? 26 or 27? Have you considered doing a custom backup and restoring manually to 15.7?
Unfortunately I don't have the spare 8 TB. Been unemployed for 6 months, have not gotten a single offer in that time, + memory/storage crisis, etc. Shit's fucked.
I don't think I would downgrade though. I just hope this gets fixed someday... I can deal with the terrible memory bandwidth but I don't like to reboot.
(That said, macOS is so, so much better at reboots than Windows)
4 replies →
macOS's OOM manager suspends and pages out processes when it hits a hard OOM event, and then usually (though not always) brings up a window to help you decide what to kill. However, once you do that, you have to then resume those processes that were suspended using that OOM window. If you don't do that (or if the process is terminated for you without the OOM window showing up, then a restart is the simplest solution to restart those processes.
I never ran out of memory and processes were never suspended. I have 128GB of memory and this happens even when total memory usage stays well under the available capacity.
But you're on a beta release?