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

Operations randomly hang and consume tons of memory #938

Closed
williewillus opened this issue May 19, 2023 · 14 comments · Fixed by #1023
Closed

Operations randomly hang and consume tons of memory #938

williewillus opened this issue May 19, 2023 · 14 comments · Fixed by #1023
Labels
bug Something isn't working

Comments

@williewillus
Copy link

Description of the bug

Operations such as git prev or git checkout --detach hang and consume tons of memory (>10G).

If I SIGINT the process and check git status, it appears the operation went through.

Expected behavior

Not hang

Actual behavior

Hang

Version of rustc

1.65

Automated bug report

report.txt

Version of git-branchless

No response

Version of git

No response

@williewillus williewillus added the bug Something isn't working label May 19, 2023
@williewillus
Copy link
Author

Probably related to #937.
I tried uninstalling branchless and reinstalling it into the repo but the problem still persists.

@williewillus
Copy link
Author

The process hanging has command line git-branchless hook reference-transaction committed

@arxanas
Copy link
Owner

arxanas commented Jun 7, 2023

Hi @williewillus, do you notice git-branchless printing a lot of output lines saying that it processed new references/branches? You can also try applying #913 to see if it improves the behavior of the reference-transaction hook.

Can you also say how big your packed-refs file is, i.e. wc -l .git/packed-refs?

If you are working with a large repository, the problem might not be with the reference transactions, but instead with working copy snapshots. You can try disabling branchless.undo.createSnapshots and see if it helps.

@surajrmal
Copy link

I'm having the same issue. My .git/packed-refs is 136 lines. Disabling branchless.undo.createSnapshots didn't seem to help either.

@surajrmal
Copy link

re-installing git branchless via cargo fixed my issue.

@arxanas
Copy link
Owner

arxanas commented Jul 2, 2023

@williewillus does git smartlog complete in a reasonable amount of time? It might just be the post-operation smartlog printing which is using too much time and memory, as it's not efficiently implemented (see #937).

@williewillus
Copy link
Author

williewillus commented Jul 10, 2023 via email

@arxanas
Copy link
Owner

arxanas commented Jul 12, 2023

@williewillus unfortunately, I don't have time lately to debug git-branchless issues. If you want to investigate yourself, you can follow the profiling section of the runbook: https://github.com/arxanas/git-branchless/wiki/Runbook#profiling and see what operation is taking too long.

@eugeneoden
Copy link

Is it possible this is an issue in v0.7.0 (the latest released to crates.io and installed via cargo install) which was later fixed?

I ran into this today with v0.7.0 but installing from the repo master (6dcdd06) works fine.

@arxanas
Copy link
Owner

arxanas commented Jul 25, 2023

@williewillus want to try building from source as per the above comment? You can see the installation instructions here: https://github.com/arxanas/git-branchless/wiki/Runbook#global-installation

@williewillus
Copy link
Author

williewillus commented Jul 25, 2023 via email

@edwintorok
Copy link

edwintorok commented Aug 17, 2023

Just to add another datapoint: git-branchless 0.7.0 ends up consuming >20G of memory and eventually have to kill it when it doesn't finish 30m later on a repo of mine, but completes successfully and quickly once installing the latest git.

@arxanas
Copy link
Owner

arxanas commented Aug 20, 2023

@edwintorok what versions of Git were you running before and after?

@edwintorok
Copy link

@arxanas sorry I should've been clearer by 'the latest git' I meant 'the latest version of git-branchless from git'.
The version of git (the tool) is unchanged: 2.41.0, I've changed the version of git-branchless from 0.7.0 to latest git-branchless https://github.com/arxanas/git-branchless#2bf7e754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants