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

I once complained about malloc happily allocating memory that the physical memory system couldn't satisfy (never let your hand write a check your ass can't cash?) but the more experienced programmer asked me if I'd heard of fractional reserve banking, and if not, whether it bothered me too.


> I once complained about malloc happily allocating memory that the physical memory system couldn't satisfy (never let your hand write a check your ass can't cash?) but the more experienced programmer asked me if I'd heard of fractional reserve banking, and if not, whether it bothered me too.

What if you are worried about both? ;-)


Swap space is the Federal Reserve of memory allocation.


Conspiracy theorists hate it?


Oh. but is there a scenario where it might be useful to check if a certain amount of memory can be available? Like say you know a certain process uses 6 Gigs for memory but will take a while to get to that point.. and then fail, is it not safe to just error out earlier?


Not the same thing.

malloc() can tell everybody it has the memory but when push comes to shove the OS will have to admit overbooking.


What do you think is a bank run?


That's exactly what fractional reserve banking is.


Funny thing, you are right. I was thinking about something else I guess.


TIL, unless you explicitly disable memory overcommit, it can and will overcommit.

This is crazy to me.


So, uh, how do you feel about fractional reserve banking? Nearly all banks worldwide practice it. Statistically, it's not impossible that the entire world financial system could collapse due to uncorrelated bank runs.


It is impossible. Only a moron of magnificent magnitude would fail to print additional cash to cover the run.

The problems caused by the feds failure to lend to First Bank of America during the Great Depression are well understood by the central banks.

What would likely happen is the overnight rate would go up to 12%, and additional money would be printed to cover withdrawals for the month or two most people would be willing to forgo 12% interest in a potentially inflationary economy.


i mean, the world financial system did almost just collapse, not that long ago, https://en.wikipedia.org/wiki/Financial_crisis_of_2007%E2%80... more or less due to the confluence of several adverse events, each of which probably could have been buffered on its own.

When you say additional money would be printed, I assume you mean the M0 money supply would be increased?


In the case of a bank run specifically yes. In the more general case of a deleveraging (2008) it would be QE / asset purchases.


It's not impossible, no, but in the case of my computer a single user - me - controls memory usage.

I guess it's beneficial in >99% of use-cases, and the <1% of other cases can turn it off. Still I guess I'm naive enough to hope a correct program would not crash.


Fractional reserve, not fractional assets.


It is not. It is actually very useful and advantageous for many reasons.

The disadvantage is the pretty shitty failure mode.

But in practice, I have never seen an operating system that was not a toy that was able to reliably, gracefully handle out of memory condition.


If you're smart, the answer is yes, over reliance on statistical multiplexing scares the shit out of you, because it's all fun and games till the check is due.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: