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
I think this is the equivalent to gh-129726? (Hadn't seen this issue until just now). If so, has a fix which has been backported to 3.12. Similar concept, but broke refloop by adding a weakref (PR: #130055)
Bug report
Bug description:
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
Potential solution
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Linked PRs
gzip.GzipFile
#130916The text was updated successfully, but these errors were encountered: