Message217283
"Because if a code creates many such objects which basically just do
calloc(), on operating systems with memory overommitting (such as
Linux), the calloc() allocations will pretty much always succeed, but
will segfault when the page is first written to in case of low memory."
Overcommit leads to segmentation fault when there is no more memory, but I don't see how calloc() is worse then malloc()+memset(0). It will crash in both cases, no?
In my experience (embedded device with low memory), programs crash because they don't check the result of malloc() (return NULL on allocation failure), not because of overcommit. |
|
Date |
User |
Action |
Args |
2014-04-27 16:38:51 | vstinner | set | recipients:
+ vstinner, pitrou, njs, skrah, neologix, jtaylor, josh.r |
2014-04-27 16:38:51 | vstinner | set | messageid: <1398616731.4.0.50026045517.issue21233@psf.upfronthosting.co.za> |
2014-04-27 16:38:51 | vstinner | link | issue21233 messages |
2014-04-27 16:38:51 | vstinner | create | |
|