TeamCity 7.0 Help

Free disk space

Free disk space Adding Build Features allows to ensure the build gets enough disk free space.

Before the build, the agent will check the current available disk free space. If the amount is less then specified, it will try to clean data of other builds before proceeding.

The data cleaned includes:

  • checkout directories that were marked for Build Checkout Directory;

  • cache of previously downloaded artifacts (that were downloaded to the agent via TeamCity artifact dependencies)

  • contents of other build's checkout directories in the reversed most recently used order.

The disk space check is performed for two locations: agent's temp directory and build checkout directory.

By default each build has the required free space set to 3Gb.

You can specify custom free disk space value in UI - as the build feature in Build Configuration settings.

If you need to make sure a checkout directory is never deleted while freeing disk space, set system.teamcity.build.checkoutDir.expireHours property to "never" value. See more at Build Checkout Directory.

Other ways to set the free disk space value

Also, for compatibility reasons free disk space value can be specified via properties. It is advised to use Adding Build Features as the properties can be removed in the future TeamCity versions. The properties can be defined:

  • globally for a build agent (in agent's buildAgent.properties file)

  • for a particular build configuration by specifying its system properties.

Required free space value is defined by the following properties: system.teamcity.agent.ensure.free.space for build checkout directory. system.teamcity.agent.ensure.free.temp.space for agent's 'temp' directory. If teamcity.agent.ensure.free.temp.space is not defined, the value of teamcity.agent.ensure.free.space property is used.

The values of the properties specifies the size of the free disk space to ensure before the build start. The value should be a number followed by kb, mb, gb, kib, mib, or gib suffix. Use no suffix for bytes. e.g. system.teamcity.agent.ensure.free.space = 5Gb

Last modified: 20 April 2023