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

OOM error on small repo when cloning/pull #276

Open
DUOLabs333 opened this issue Apr 20, 2022 · 31 comments
Open

OOM error on small repo when cloning/pull #276

DUOLabs333 opened this issue Apr 20, 2022 · 31 comments

Comments

@DUOLabs333
Copy link

DUOLabs333 commented Apr 20, 2022

I have a very small repo (~1Mb), yet when cloning, git-remote-https gets killed because the system runs out of memory. It's only this repo, all others work fine.

@DUOLabs333 DUOLabs333 changed the title OOM error on small repo OOM error on small repo when cloning/pull Apr 20, 2022
@jonashaag
Copy link
Owner

Can you share the repo?

@jelmer
Copy link
Contributor

jelmer commented Apr 20, 2022

Which version of Dulwich are you using? There have been some fixes recently that improve the strategy for delta resolution - significantly improving memory usage on certain kinds of repository.

@DUOLabs333
Copy link
Author

@jonashaag It's a private repository.

@masatake
Copy link

masatake commented Apr 20, 2022

Do you use ctags (in klaus)?

@DUOLabs333
Copy link
Author

DUOLabs333 commented Apr 20, 2022

No, I don't think so. How would I know if I do?

@DUOLabs333
Copy link
Author

Which version of Dulwich are you using? There have been some fixes recently that improve the strategy for delta resolution - significantly improving memory usage on certain kinds of repository.

I'm using version 0.20.35, which seems to be the latest version.

@jonashaag
Copy link
Owner

Maybe you can send the private repo via email so I can check it out

@DUOLabs333
Copy link
Author

@jonashaag
Copy link
Owner

Thanks, will have a look tomorrow.

@DUOLabs333
Copy link
Author

Correction: this is happening on all but a few of my repos.

@jonashaag
Copy link
Owner

@jelmer can you look into this? I'm not sure what's going on here. It seems to hang inside git-remote-http but I can't find any meaningful differences in the info/refs?service=git-upload-pack compared to what GitHub responds. (Except for an extra 0x20 character in Dulwich's reponse which doesn't seem to make any difference)

@DUOLabs333
Copy link
Author

@jonashaag So you can recreate this issue with the repo I sent? Does this happen with any of your repos?

@jonashaag
Copy link
Owner

Yes it happens with my repos as well. I wonder if it has something to do with a recent Git release but an older version of Git had the same issue.

What’s the OS you run git on? I tried macOS only.

@DUOLabs333
Copy link
Author

DUOLabs333 commented Apr 21, 2022

This is with Arch Linux.

@DUOLabs333
Copy link
Author

Where is the code for that stored? Maybe I can take a look at it? (Also, maybe you should think of adding an option to use git-http-backend instead).

@jonashaag
Copy link
Owner

The memory leak is in the git-remote-http code

@DUOLabs333
Copy link
Author

Wouldn't that indicate somethings wrong on the server's side?

@jonashaag
Copy link
Owner

Yes, and/or in Git.

@jelmer
Copy link
Contributor

jelmer commented Aug 12, 2022

FWIW a number of memory improvements have gone into Dulwich' server gode recently.

@DUOLabs333
Copy link
Author

Ok, I'll try it out.

@DUOLabs333
Copy link
Author

The problem seems to remain (dulwich 0.20.45).

@jonashaag
Copy link
Owner

@jelmer any idea what's going on here? I'm facing the same problem now on macOS with the latest Dulwich and Git.

@jonashaag
Copy link
Owner

It starts to happen with Git 2.28. 2.27 is fine.

@jonashaag
Copy link
Owner

@jonashaag
Copy link
Owner

@jelmer note that the memory leak is in the client

@jonashaag
Copy link
Owner

jonashaag commented Apr 7, 2023

Screenshot 2023-04-07 at 10 41 29

Profile of the infinite loop in the Git client

@jelmer
Copy link
Contributor

jelmer commented Apr 7, 2023

Can you reproduce this with git on the server side?

@jonashaag
Copy link
Owner

It works fine with git daemon --verbose --port=8080 --base-path=. --export-all.

Anything else I should check?

@jonashaag
Copy link
Owner

I reported a Git bug.

@jonashaag
Copy link
Owner

@jelmer FYI see discussion here. Bug in Git that is about to be fixed. https://lore.kernel.org/git/39035D34-8548-44B0-BBBB-5C36B3876C4A@lophus.org/

@jelmer
Copy link
Contributor

jelmer commented Apr 12, 2023

Interesting - thanks for the link & background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants