Skip to content

Conversation

@pmhahn
Copy link
Collaborator

@pmhahn pmhahn commented Jul 4, 2018

python-notifier.thread.Simple objects are not garbage collected as they implement the __del__ method. See individual commit message and Bug #47114 for more details.

pmhahn added 2 commits July 4, 2018 09:39
The Python garbage collector (GC) nowadays can free cyclic structure,
but only if that cycle does NOT contain objects implementing the
`__del__` method, as the GC then cannot decide which object to free
first: That method is only called *after* the GC has decided to free the
object and then it is pointless to clean the exception data.

Remove the `__del__` method.

<https://docs.python.org/2/library/gc.html#gc.garbage>
The Python garbage collector (GC) nowadays can free cyclic structure,
but keeping a Traceback object is still considered a bad idea: It
contains a reference to all stack frames, which reference all local
variables, and thus the traceback itself.

Format the traceback once and replace the reference with None.
The standard traceback library handles this fine.

<https://docs.python.org/2/library/sys.html#sys.exc_info>
@crunchy-github crunchy-github merged commit 650d6f8 into univention:master Jul 4, 2018
@pmhahn pmhahn deleted the gc-leak branch August 8, 2018 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants