Taming the OOM killer
Taming the OOM killer
Posted Jul 16, 2014 12:18 UTC (Wed) by dgm (subscriber, #49227)In reply to: Taming the OOM killer by dgm
Parent article: Taming the OOM killer
Posted Jul 16, 2014 15:07 UTC (Wed)
by nybble41 (subscriber, #55106)
[Link]
CoW is still a form of overcommit, even if it's not referred to as such. In the one case you commit to allocating a new page in the future, on the first write, and pre-filling it with a copy of an existing page. In the other case you commit to allocating a new page in the future, probably on the first write, and pre-filling it with zeros. In both cases you're writing an IOU for memory which may not actually exist when it's needed.
You could pre-allocate memory for CoW while deferring the actual copy, but that would only be a performance optimization. You'd still have the problem that fork() may fail in a large process for lack of available memory even though the child isn't going to need most of it.
Taming the OOM killer