-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Open
Labels
enhancementFeature requests, new feature implementationsFeature requests, new feature implementations
Description
This is a common error when creating a zlib.DecompIO(f)
:
MemoryError: memory allocation failed, allocating 32768 bytes
Obviously the buffer is necessary (for any streams you don't control the creation of, almost always w/ wbits=15
), but that's a third of available ram, and sometimes the GC doesn't purge the old one in time to create the new one, or because of fragmentation there's no contiguous space available.
Could we add a function to reset the internal state? IE decomp.reset(f)
That way it could reuse the previous allocation, eliminating the risk of an OOM if resetting instead of creating anew.
Would you be willing to sponsor this work? Yes, if the concept is agreed to.
Metadata
Metadata
Assignees
Labels
enhancementFeature requests, new feature implementationsFeature requests, new feature implementations