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

🐞 Bug run_command - Ruby IO.popen memory leak #336

Open
Rikj000 opened this issue Nov 30, 2024 · 0 comments
Open

🐞 Bug run_command - Ruby IO.popen memory leak #336

Rikj000 opened this issue Nov 30, 2024 · 0 comments

Comments

@Rikj000
Copy link

Rikj000 commented Nov 30, 2024

Issue Description

There appears to be a memory leak in svn2git's run_command function,
I assume in IO.popen.

This memory leak leads to eating up all the RAM + Swap memory (128Gb + 64Gb on my system) during large conversions,
which will eventually crash the svn2git process once RAM is full.

In below btop screenshots you can see that:

  • This issue occurs while svn2git is running git svn fetch (which is called through run_command)
  • git svn fetch does not experience a memory leak, since it's memory usage stays low
  • svn2git does experience a memory leak, since it's memory usage keeps on growing
Click to Expand/Collapse the "Screenshots"

0h40min - 33.4Gb

33.4Gb RAM + 0Gb Swap
svn2git-0h-40min

1h01min - 51.6Gb

56.1Gb RAM + 0Gb Swap
svn2git-1h-01min

2h11min - 120Gb

56.1Gb RAM + 63.9Gb Swap
svn2git-2h-11min

3h00min - 159.6Gb

95.7Gb RAM + 63.9Gb Swap
svn2git-3h-00min
svn2git-git-svn-fetch-3h-02min

Work Around

  1. Either wait for svn2git to crash when out of memory,
    or manually force stop it with x2 CTRL + C
    (and also docker container ls + docker stop <container-id> when using Rikj000/Ruby-SVN2Git-Docker)
  2. Process continues upon restart, however:
    • In case of crash upon restart, fix by:
      • Open the .git/config file in the output Git repo
      • Delete all branches + tags entries within
      • Delete the .git/svn/refs/remotes/svn/trunk/index.lock file in the output Git repo, if it exists
    • Disk space cleanup before restart:
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

1 participant