libgit2 / libgit2/libgit2sharp

Out of memory error when identifying changed files. The repository has over 4 lakh files.

Open
#1,786 0 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

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.