Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because OoM errors are oh so fun.
 help



I write algorithms that operate on predictable amounts of data. It's very easy to work out the maximum amount of things we need to have and then allocate it all in fixed size arrays. If you allocate all your memory at startup you can never OOM at runtime. Some containers need over 100GB but like the parent comment said we've already bought the RAM.

I write algorithms that operate on less predictable amounts of data.

If you operate over all of your data every time it's a lot more predictable ;)

Caches are automatically released by the OS when demand for memory increases.

You eventually run out of caches to evict.

That is completely irrelevant to this discussion about using the RAM you’ve paid for.

At that point you can still fall back onto swap on NVME.

Doesn’t Apple use pretty damn quick NVME? I wonder how much of a performance drop it actually is. Certainly not as bad as running a swap file on a 5400 rpm HDD…

Isn't that NVME also very expensive to replace because it's tied to hardware identifiers? If you keep swapping all the time, surely NVME would be the first part to fail

This was heavily debated in the 11.4 timeframe because there was risk that this version of the OS could excessively wear NVME.

https://appleinsider.com/articles/21/06/04/apple-resolves-m1...

The issue was subsequently resolved but the consensus was with modern wear leveling this isn't so much a thing.

I have a 2021 MacBook Pro with the original drive. I use it heavily for development practically every day and just dumped the SMART data.

Model Number: APPLE SSD AP1024R

=== START OF SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

Available Spare: 100%

Available Spare Threshold: 99%

As always, YMMV


How often are ooms caused by lack of ram rather than programming?

> How often are ooms caused by lack of ram rather than programming?

You're right, but in a production deployment, that extra ram might mean the difference between a close call that you patch the next day and an all hands emergency to call in devops and engineers together during peak usage.

source: been there


we're still talking about the MacBook, right?

> we're still talking about the MacBook, right?

na, this is just PTSD talking


I don't think MacOS OoMs as Linux

(and to be honest the way Linux does acts on OoMs are quite debatable)


macOS can OOM, ish.

If you don't have any more disk space for swap, or memory pressure gets too high, you get the "You've ran out of application memory" dialog box with a list of applications you can force quit, and macOS leaves it up to the user on what to kill instead of the system choosing automatically.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: