How GarbageCollection mechanism and strategies work in Artifactory? [Video]

Maayan Amrani
2021-01-28 08:12

The garbage collector is one of the regular maintenance processes in Artifactory that is running regularly, every 4 hours.

Video Transcription

Hi, my name is Maya. I’m from JFrog Support. In this short video, we will walk through the garbage collector mechanism. So let’s start.

The garbage collector is one of the regular maintenance processes in Artifactory, which is used periodically in order to make sure the system does not become clogged with unused binaries. The GC identifies unused binaries and deletes them from the file store. By default, it is set to run every four hours, and we may change it by modifying the Cron Expression. We may run it through a Post request or via the UI.

Now, as you may know, when we delete a file from Artifactory, it is not removed from the file store, as it might be in use under different paths. This is where the full GC strategy comes in. By full GC strategy, we refer to 20 iterations of the GC. After those 20 GC runs, the files that were identified for deletion will be removed from the file store. This default value of 20 can be customized through skip full GC between minor iteration system property, configured under the etc folder within the Artifactory system properties file. There are also other GC related properties to improve performance.

Now let’s take a look. So before recording this video, I actually deleted an artifact from Artifactory and I also ran the garbage collector 19 times. So this will be the 20th time it will be run. This means that we actually completed the full cycle of the GC.

We can see here on the right side, that the garbage collector threw some kind of a small report about the latest run. We can see that it deleted one artifact with size of 40 megabytes. So this is actually the artifact that I deleted. If we do LL, now, we can see that the artifact is gone.

That’s it. I hope you have enjoyed. I highly recommend to take a look into our official documentation about the garbage collector, and please feel free to leave feedback or raise any questions in the comments below. Thank you. Bye-bye.