Tony Reix <tony.r...@atos.net> added the comment:
Some more explanations. On AIX, the memory is controlled by the ulimit command. "Global memory" comprises the physical memory and the paging space, associated with the Data Segment. By default, both Memory and Data Segment are limited: # ulimit -a data seg size (kbytes, -d) 131072 max memory size (kbytes, -m) 32768 ... However, it is possible to remove the limit, like: # ulimit -d unlimited Now, when the "data seg size" is limited, the malloc() routine checks if enough memory/paging-space are available, and it immediately returns a NULL pointer. But, when the "data seg size" is unlimited, the malloc() routine first tries to allocate and quickly consumes the paging space, which is much slower than acquiring memory since it consumes disk space. And it nearly hangs the OS. Thus, in that case, it does NOT check if enough memory of data segments are available. Bad. So, this issue appears on AIX only if we have: # ulimit -d unlimited Anyway, the test: if (size > (size_t)PY_SSIZE_T_MAX) in: Objects/obmalloc.c: PyMem_RawMalloc() seems weird to me since the max of size is always lower than PY_SSIZE_T_MAX . ---------- nosy: -facundobatista, mark.dickinson, pablogsal, rhettinger, skrah _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41540> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com