-
-
Notifications
You must be signed in to change notification settings - Fork 937
memory leak in Tree.join() #289
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
Comments
Thanks for posting. Would you update the issue with the filenames containing the code shown in the memory_profiler output ? Even though You can do that by instantiating the git.Repo("path", odbt=git.GitCmdObjectDB) Maybe this already improves things. My two cents on memory leaks in python are that they should only occour if there are cyclic strong pointers, or if there is a cache that is never cleared. The latter could exit in GitPython depending on usage patterns, the first mentioned shouldn't exist as I at least paid attention to it. However, there is a chance some cycle is in there nonetheless. I also admit that right now, I don't understand how to interpret the output presented here, which makes me poke around blindly to help fixing the issue :). That might improve though. |
thank you very much for helping me "fixing" this. and now the leak mem "seem" gone. I said "seem" because salt-master has multiple problems cause memleak than just git relate. See the changes here: saltstack/salt#17006 (comment) (I changed it in 29/5) - that is the memory of daemon that use gitpython. Anw, should I create a new issue for the gitdb project? |
I think you could consider creating a new gitdb issue if you have clear evidence on where the memory leak is created - usually this is hard to do, and more like chasing phantoms, especially in a GC language like python. Additionally GitDB/GitPython is in maintenance mode, and I am not investing any time in it unless it is possible to make fixes in 30m or less, which seems unlikely to be possible in this case. A common fix for issues related with resources (like memory, filehandles) is to use the Another solution could be to use the python bindings of libgit2 directly - it's somewhat lower-level, but depending on what you do it might still be feasible to make that change. |
Closed due to inactivity. Please comment to get it reopened. |
Hello,
I'm not a direct user of gitpython but I used it as a backend of saltstack gitfs fileserver:
Due to the mem leak problem in this issue:
saltstack/salt#17006 (comment)
I traced down the memleak happen in multiple places:
for 1, I used memory_profiler to help showing memleak, here are some results:
https://github.com/gitpython-developers/GitPython/blob/master/git/objects/tree.py#L180
And:
I'm using:
it's not clear to me why it leaked, could you please help me to figure it out / give a fix for it.
Thanks
The text was updated successfully, but these errors were encountered: