Great!
Great!
Posted May 18, 2015 15:45 UTC (Mon) by epa (subscriber, #39769)In reply to: Great! by Limdi
Parent article: Rust 1.0 released
Posted May 20, 2015 17:42 UTC (Wed)
by gmatht (guest, #58961)
[Link] (1 responses)
However (2), could be a syscall of its own. Roughly, the idea is that to avoid the OOM killer, a process is responsible for reserving memory prior to allocating it. This allows, a process to choose, for example, to:
Doing (5) may mean the process is denied reservations long before the machine is low on memory, but that's already what happens with overcommit disabled. That may be what the application writer wants. (1) can be quite nice too; sometimes it is much easier to recover from an abort than to recover from low memory. Allowing some processes to choose 1 and 5 already seems like an advantage. For lots of user space code (4) seems cleaner to me than checking the return of every "malloc(sizeof int)". When a bug is found fixing the result of corruption from an abort may be easier than fixing the result of mishandled null pointer. How often do we really need (5) in userspace?
Posted May 23, 2015 8:53 UTC (Sat)
by epa (subscriber, #39769)
[Link]
Avoiding the OOM Killer by Quotas?
1) not bother reserving memory, it probably won't be OOM killed anyway,
2) Permanently reserve 640K (which should be enough, right?),
3) Release all reservations when in a safe idle state, allowing a OOM kill,
4) Make sure it has 10MB extra in reserve before accepting a new connection, or
5) Wrap every call to malloc, fork, etc. to make sure it has enough in reserve for all children.
Avoiding the OOM Killer by Quotas?