libgit2 / libgit2/libgit2sharp

Leak when iterating through commits and diff them

Open
#1,359 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

When I run the code below on a production repository, i can see that the memory is all the time increasing and after about 3000 commits my pc crashes with out of memory.

For about 1000 commit it reserved about 500 MB Ram.

Code for Testsetup see here:
https://gist.github.com/Gentlehag/9f595ab13f459e22859fa5d9557e550b

PS: I also posted here:
http://stackoverflow.com/questions/39258639/possible-leak-when-reading-content

My target is to just iterate through all commits and getting all files that were changed in eahc commit.

Is there a better way ? Is this a bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reproduction linked in the issue's GitHub Gist and observe memory while iterating through commits and diffs. Compare the behavior with the Stack Overflow discussion, then identify whether the leak is in commit iteration or diff handling; done means reproducing the growth and establishing a verified fix or documented alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.