3 ms·
The problem with disabling the memory overcommit is that then the RAM is wasted. That can be worked around with setting up swap but then the disk space is waste
by mono442 3mo ago
The problem with disabling the memory overcommit is that then the RAM is wasted. That can be worked around with setting up swap but then the disk space is wasted.
- man8alexd 3mo agoPeople like to reinvent things that they are not aware of. Original BSDs used to use strict swap reservation - every anonymous memory page had to have an associated swap page. You had to have the swap 2x of RAM to allow large processes to fork - otherwise you would get an "out of swap" error. FreeBSD implemented overcommit around 2000, I think version 4.x or 5.x.
- frollogaston 3mo agoWhy are programs even allocating memory that they don't use?
- man8alexd 3mo agoBecause no one can predict the future, and they don't know how many resources they will need.
- frollogaston 3mo agoI mean they can just malloc when they need more, what am I missing? Unless this is about JVMs which might preallocate a ton for their heaps and not use it
- swappie 3mo agoApps could, yes. But it’s about 1000x slower to call the OS to allocate a new page, than to just use a pointer to preallocated space.