3 ms·
What bothers me is that I read this train wreck without any red flags until I saw his correction at the end. Even the headline was wrong given the article, whic
by jvanderbot 7y ago
What bothers me is that I read this train wreck without any red flags until I saw his correction at the end. Even the headline was wrong given the article, which itself was wrong.
I really should have coffee before HN
- dragontamer 7y agoWhat exactly is "wrong" about the article? Linux's Overcommit behavior is non-obvious to many programmers. Its one of those issues that very few programmers I've come across in the workplace understand properly. This blogpost properly understands the issues associated with Overcommit, and have done some preliminary investigations that describe the behavior. Its a really good blogpost. The general point of the blogpost is that "Malloc Fails due to address space exhaustion more often than actual memory-exhaustion". Because actual memory exhaustion causes OOM killer code to be run... and OOM killer is a non-obvious case of the Linux kernel.
- 95014_refugee 7y agoWhat's "wrong" about the article is that the author has no idea what malloc(3) does, or about the wide range of execution environments C programs find themselves in and the different ways that the API maps to those environments. More generally, the article does nothing to educate the public or move the "debate" about overcommit in any sort of useful direction.
- shereadsthenews 7y agoWhat's wrong with the article is that malloc is not even a feature of Linux. There's mmap and brk, both of which have documented failure modes.
- dragontamer 7y agoMost typical programmers will be using malloc, or some mechanism built on top of malloc (C++ new). MMap and brk are useful for certain situations (explicitly getting Huge Pages), but I don't think that the typical programmer necessarily needs to know about those. Since glibc malloc is built on top of mmap and brk, I think your distinction is mostly academic. For any programmer using Linux and glibc... malloc's failure mode IS mmap and brk failure modes.
- shereadsthenews 7y agoIt is a mischaracterization to say that C++ operator new is built on top of malloc. If your new is overridden by, say, tcmalloc, your program will never call malloc.
- zonidjan 7y agoIt is a feature of your chosen libc, which has to then interact with those system calls, in a way that gives malloc a peculiar behavior on Linux specifically as opposed to other OS.