-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote objects are never destroyed, which means Repository is never destroyed #403
Comments
A side-note.. the memory leak needs fixing either way, but does the Remote actually need the |
A |
The fix looks like it would be to keep the callback payload as |
Ah yes, having the reference makes sense. Since a few functions need the callbacks and there are various exceptions etc, maybe have a decorator like |
Those callbacks are only for fetch, so we shouldn't need anything so complicated. The only thing the reference really needs to outlive is the There's a way to retrieve the set callbacks, but the simplest thing to do is probably to move the callback setting to the beginning of |
This is a similar issue to #321 #326 #328, but the cause is different
When I do this:
I get this:
~/src$ python testgit.py refcount before: 2 refcount after: 101
The root cause is the
self._self_handle
in theRemote
object. Because it's an opaque reference through ffi, it seems that the python garbage collector can't detect the circular reference of the Remote to itself. That means it never gets cleaned up, and it leaks a reference to the repo inself._repo
, so that never gets cleaned up either.The text was updated successfully, but these errors were encountered: