[issue21233] Add *Calloc functions to CPython memory allocation API

Antoine Pitrou report at bugs.python.org
Sun Apr 27 21:09:37 CEST 2014


Antoine Pitrou added the comment:

> Hm...
> What's /proc/sys/vm/overcommit_memory ?
> If it's set to 0, then the kernel will always overcommit.

Ah, indeed.

> If you set it to 2, normally you'd definitely get ENOMEM

You're right, but with weird results:

$ gcc -o /tmp/test test.c; /tmp/test
malloc() returned NULL after 600MB
$ gcc -DDO_MEMSET -o /tmp/test test.c; /tmp/test
malloc() returned NULL after 600MB

(I'm supposed to have gigabytes free?!)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21233>
_______________________________________


More information about the Python-bugs-list mailing list