>>> l = [b''] * (100*1024*1024) [104918914 refs] >>> d = b''.join(l) Traceback (most recent call last): File "", line 1, in SystemError: error return without exception set (you'll have to adjust the list size based on your system memory size)
Antoine, on Unix you can restrict the address space of a program to test the issue without almost crashing and OOMing your box. ;) >>> import resource >>> resource.setrlimit(resource.RLIMIT_AS, (1024*1024*100, 1024*1024*100)) >>> l = [b''] * (100*1024*70) >>> d = b''.join(l) Traceback (most recent call last): File "", line 1, in MemoryError I wonder why I don't see a memory error in Python 3.3 or earlier. Any idea?
> I wonder why I don't see a memory error in Python 3.3 or earlier. Any idea? See issue #15958. Now join() accept arbitrary buffer objects, which can be modified during iteration, and therefore need a temporary list of Py_buffers.
> Antoine, on Unix you can restrict the address space of a program to > test the issue without almost crashing and OOMing your box. ;) Ah, thanks, but I didn't crash and OOM it, since it has no swap: memory errors get raised quickly here :)
History
Date
User
Action
Args
2022-04-11 14:57:38
admin
set
github: 60796
2012-12-02 10:33:08
pitrou
set
status: open -> closedstage: needs patch -> resolved