You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During debugging memory buildup, I've noticed gzip.GzipFile holds a reference to itself (Cycle: GzipFile._buffer->BufferedWriter._raw->_WriteBufferStream.gzip_file-> GzipFile). This cycle prevents memory from being freed until the garbage collector runs a deep cleanup cycle (generation=2).
Steps to reproduce
Disable garbage collection temporarily to make sure we are the ones who catch it
Set the garbage collector's debug level to DEBUG_LEAK
Bug report
Bug description:
During debugging memory buildup, I've noticed
gzip.GzipFileholds a reference to itself (Cycle:GzipFile._buffer->BufferedWriter._raw->_WriteBufferStream.gzip_file->GzipFile). This cycle prevents memory from being freed until the garbage collector runs a deep cleanup cycle (generation=2).Steps to reproduce
Potential solution
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Linked PRs
gzip.GzipFile#130916