-
Notifications
You must be signed in to change notification settings - Fork 33
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
Garbage collection may not be performed often enough #27
Comments
Just like I thought, JGit is supposed to check during common porcelain commands (e.g. But it seems that the default threshold value for when garbage collection is triggered (6700 loose objects) might be a bit high for the mobile use case. Either that, or JGit or Orgzly is handling the Git repo in a particularly inefficient manner. Because I am fairly sure that Orgzly's syncing has been sped up the times that I have performed garbage collection on repo clones which have been used for a year or so. I looked at my laptop clone of my above-mentioned repo, and it was 48 MB. I ran So I suppose we could consider setting a lower threshold, and garbage collection should happen more often. But testing this to find a good value is obviously quite tricky. One possible heuristic for deciding how often to perform manual garbage collection is suggested on Stack Overflow:
I suppose we could use a similar method: Set a slightly lower |
I just noticed that my day-to-day repo could be shrunk from >6 MB to 2.7 MB by running a regular "git gc". This means that more than half of its content was garbage, which should have been collected. I also confirmed that a recent clone of the repo is much more nippy in Orgzly. Related to issue #27.
I just verified this by running "git gc" on my main repo in a long running Orgzly install. The repo shrank from 18 to 3 MB.
We should be able to trigger gc but let Git decide whether it's necessary. That way it should not need to prolong the typical syncing experience.
The text was updated successfully, but these errors were encountered: