Skip to content

transport.UploadPack runs out of memory and is very slow with large repos (linux.git) #1691

@wrouesnel

Description

@wrouesnel

Bug Description

As in the summary: trying to implement a smart git server works fine with small repos, but essentially locks up until it runs out of memory for a big git repo - I'm testing with the Linux kernel and a small handler library I put together (intended to be part of another project).

Obviously this is a big repo (hence a good use of a pathological use case) but it's not enormous - 8gb, even if read entirely into RAM, would fit on this machine.

go-git Version

v6.0.0-20251009132922-75a182125145

Steps to Reproduce

  1. Clone the Linux kernel - git clone https://github.com/torvalds/linux.gt
  2. Clone the test application git clone https://github.com/wrouesnel/go.git-http-handler
  3. Serve the Linux kernel locally:
cd go.git-http-handler
go run ./cmd/git-server --base-dir ../linux.git 
  1. Attempt a git clone from the local server in another window
git clone http://localhost:8080

This will just not complete.

Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingperformancestaleIssues/PRs that are marked for closure due to inactivity

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions