How is the approximate repository size calculated in Bitbucket Data Center?

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When viewing a repository's settings, clicking Retrieve size details can give an estimate of its size. How is the approximate size calculated?

Solution

Bitbucket Data Center uses the following process to calculate the approximate size of repositories:

  1. First it checks if any pack files exist in the repository. If there are pack files, the approximate size of the repository is considered to be the size of all found pack files combined, and the process is finished.
  2. If there are no pack files in the repository Bitbucket will instead traverse the loose objects in the repository one by one and calculate the approximate file size by summing up the file sizes of the individual loose objects it encounters.


Limitations

We talk about "approximate size" because the calculation is not expected to be accurate. There are some factors that limit how accurately the size is calculated:

  • For performance reasons the process of traversing loose objects (step 2 above) is time-limited to 75 milliseconds. Any loose objects that the Bitbucket server isn't able to traverse within those 75 milliseconds will not be included in the calculation. This means that repositories that are particularly large or that reside on volumes with slower read speeds may show more inaccurate data. This also explains why you might see varying results if you repeatedly have the Bitbucket server calculate the approximate size. The timeout of 75 milliseconds is hardcoded and can't be configured, and it does not apply to the calculation of the repository size if pack files exist (step 1 above).
  • LFS data is not included in the calculation
  • There is a known issue with the repository settings view showing inaccurate repository sizes. This is under review as per BSERV-13879.

The only reliable way of sizing a repository is to perform a full clone of it and then check the resulting directory's size on disk.



Last modified on Nov 1, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.