Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Git's built-in garbage collection vs JGit handling of garbage collection operation(Built-in Git vs JGit garbage collection mechanism)  () 1 Vote
Git's built-in garbage collection vs JGit handling of garbage collection operation [message #1867818] Mon, 08 July 2024 13:44 Go to next message
Eclipse UserFriend
Hello team,

Here are the few points :

1) Git's built-in mechanism automatically triggers the git gc when the number of loose objects are high or it detects repository size is huge and objects should be garbage collected.

2) Git's garbage collection is by default automatically executed alongside frequently used Git commands like git commit, git pull, and others.

Questions:-

1) What about the JGit handling of garbage collection ? Does Jgit APIs like PULL, COMMIT...etc automatically trigger git gc internally or is there any configuration to do that ?

A test on local repository shows that by default JGit APIs does not run git gc (opposite to Git's built-in gc as it runs automatically executed alongside frequently used Git commands like git commit, git pull, and others whenever necessary)

2) If all operations on a local repository are performed through JGit APIs, does it mean that garbage collection may never occur and it must be explicitly triggered from time to time using git gc command or JGit's GC API to reduce repository size ?

Thanks,
Ajay K
Re: Git's built-in garbage collection vs JGit handling of garbage collection operation [message #1869060 is a reply to message #1867818] Tue, 30 July 2024 19:12 Go to previous message
Eclipse UserFriend
ReceivePack, FetchCommand, MergeCommand, RebaseCommand should run auto gc if it's not disabled via git configuration.
See callers of org.eclipse.jgit.internal.storage.file.GC#setAuto
Previous Topic:Writing commits into the git repository using jgit takes longer than expected
Next Topic:How to overide the maxObjectSize in FetchCommand
Goto Forum:
  


Current Time: Fri May 23 02:10:37 EDT 2025

Powered by FUDForum. Page generated in 0.03492 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top