Also reminds me that I really would like to find a way that PG can detect allocation failures without requiring memory overcommit to be turned off globally. Just causes too many other programs to misbehave, and is a complicated explicit configuration.https://twitter.com/AndresFreundTec/status/1225559052475871233 …
So linux (many other OSs do similarly) just doesn't count unused but allocated memory, unless you enable strict memory accounting. But when you then access the memory (by just dereferencing a pointer) and there is no actual free memory left, there is nothing to return NULL to.
-
-
So if they can't make space, they have to just kill that, or some other program. The reason for telling you that, is that it's not clear what turning overcommitting off "per application" would precisely mean. Memory is a global resource after all.
-
What you would have to do to make sure you never run into not having memory available to back an earlier allocation, is to always immediately back it with memory, while the OS can signal an error. But that a) isn't easy b) has some DOS potential and such.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.