libgit2 / libgit2/libgit2sharp
Out of memory error when identifying changed files. The repository has over 4 lakh files.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
Out of memory error while trying to find the changes in a repo.
Reproduction steps
Finding out untracked/modified files in the repo with over 4 lakh files is causing out of memory error.
Expected behavior
It should be optimized for memory use while trying to find out changes.
Actual behavior
out of memory error in the code below.
Class: Index
Method : AllIndexEntries( )
It is enumerating all entries and tries to fill the list, instead it could have been implemented as callback to reduce the memory pressure.
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
Windows 10, .NET 4.8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Index.AllIndexEntries method named in the report and trace the code that enumerates untracked and modified files. Reproduce the behavior with a repository containing over 400,000 files, then verify that change detection no longer exhausts memory while preserving the reported file results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100