Skip to content
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

diff has memory leak #625

Closed
mrh1997 opened this issue Apr 19, 2016 · 5 comments
Closed

diff has memory leak #625

mrh1997 opened this issue Apr 19, 2016 · 5 comments
Labels

Comments

@mrh1997
Copy link
Contributor

mrh1997 commented Apr 19, 2016

running diff on two trees (no matter if Repository.diff(), Tree.diff_to_tree()) seems to have a memory leak.
My testscript walks a big repository from root to head of master and diffs every logentry to its parent.
Although the diff result is thrown away the memory footprint of the process grows and grows (according to the Windows Taskmanager).
At some point I get a MemoryError).

My system is:

  • Windows 10 (64 bit)
  • Python 2.7.11 (32 bit)
  • pygit2 / libgit2 0.24.0
@mrh1997
Copy link
Contributor Author

mrh1997 commented Apr 25, 2016

Same Issue when using libgit 0.24.1 instead of 0.24.0 or when running it on linux (32bit).

@carlosmn
Copy link
Member

How are you performing the diff? How are you throwing away the result? Are you deleting it or letting the garbage collector decide when to delete it? Do you have some code that shows the issue?

@mrh1997
Copy link
Contributor Author

mrh1997 commented Apr 28, 2016

I extracted the bug as a small script into the following Gist: https://gist.github.com/mrh1997/9925bbb8e5f7b0ab8c88189d562ad42d

I recommend to use the attached vagrantfile. Then you may be sure that you are able to reproduce it, as it creates exactly the same machine as I used for testing...

Simply run vagrant up followed by vagrant ssh -- reproduce-pygit2-memleak.py

@mrh1997
Copy link
Contributor Author

mrh1997 commented Jun 20, 2016

@carlosmn: succeeded in repoducing the bug? Or do you need further information?

@jdavid
Copy link
Member

jdavid commented May 16, 2020

probably the same as #943 which was fixed

@jdavid jdavid closed this as completed May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants