3 ms·
Tha program that hits a malloc failure will not necessarily be the program that ate up all the RAM.
by mikeash 10y ago
Tha program that hits a malloc failure will not necessarily be the program that ate up all the RAM.
- tedunangst 10y agoMalloc failure is at least synchronous with the out of memory condition. And if your program has reached a fixed state, it may not even be calling malloc.
- cturner 10y agoOt: your flak blog could benefit from a page showing links to all articles. Currently, hard to read beyond 'recent'.
- tedunangst 10y agoDon't waste your time with the old crap. :)
- paulddraper 10y agoSure, but (a) it can handle the malloc failure and (b) it's pretty easy for the user to find the bad guy.
- deathanatos 10y agoIt might handle the malloc failure by crashing. Some languages (e.g., Rust) and runtimes (e.g., glib) presume that small allocations always succeed; a failure in such an allocation immediately crashes the program (as the underlying API provides no means to report the failure).
- steveklabnik 10y agoRust the language doesn't know anything about allocation; it's entirely a standard library decision.
- mikeash 10y ago(a) it probably won't therefore (b) the "bad guy" is going to be most/all processes.