Skip to content

reset zlib.DecompIO state #11146

@keredson

Description

@keredson

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

No one assigned

    Labels

    enhancementFeature requests, new feature implementations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy