3 ms·
The Linux kernel doesn't allocate memory until first access. Most other Unixes actually allocate when you ask them to allocate. So on BSDs, etc, malloc can and
by Sanddancer 12y ago
The Linux kernel doesn't allocate memory until first access. Most other Unixes actually allocate when you ask them to allocate. So on BSDs, etc, malloc can and will fail when you ask the computer to allocate more memory than it can actually access. Overcommitting RAM is a rather silly "optimization" and tends to cause more trouble than it actually solves.
- foxhill 12y agodarwin, NT, and linux all do this. that is the majority of systems. it's not a silly optimisation at all. at worst, it performs exactly as well as malloc. at best, it saves allocating memory. which in the mobile platform (again, most of computing), is a big deal.
- Dylan16807 12y agoIt's also rather silly to need 50GB of never-used swap space to back up a fork-heavy program.