tencent cloud

Releasing COS Storage Capacity

Download
Focus Mode
Font Size
Last updated: 2026-09-10 16:40:32
AI-Translated
Note:
TCR has recently completed a comprehensive upgrade of its underlying architecture. The garbage collection mechanism for new instances created after May 22, 2026 has been fully optimized. The upgraded architecture uses non-blocking garbage collection, so business read and write operations (push/pull) are not affected during garbage collection, and image pushes can be continuously received. The system configures a 2-hour cleanup protection window by default, and only cleans up image data created more than 2 hours ago to prevent accidental deletion of artifacts that are being uploaded.

Overview

TCR allows users to set up rules to remove unused image tags of the Enterprise Edition instances in batch. However, after you delete the image tags, the image data stored in the COS bucket associated with the instance still exists. You can use the garbage collection feature to delete the invalid image tag data in COS bucket to release the occupied storage capacity, and reduce the storage costs. This document describes how to use the garbage collection feature to release the occupied storage capacity of a COS bucket.

Notes

Garbage collection will affect the instance service status and the data in your instance. Please note the following points:
During garbage collection, the instance becomes read-only. You can pull images from image repositories, but cannot push images to the image repositories.
The garbage collection task will clean up the image layer data that is no longer associated with valid image tags in all image repositories of the instance. The deletion operation is irreversible. We recommend that you perform a dry run to evaluate the impacts before performing garbage collection.
The duration of a garbage collection task depends on the size of image data stored in COS and the number of historical image versions. After you start a garbage collection task, you can click the stop button on the console to terminate the task if needed. We recommend that you perform garbage collection during off-peak hours or use a dry run to estimate the execution time.
Note:
Important notes on storage types:
DEEP_ARCHIVE disabled: For the Cloud Object Storage (COS) bucket associated with an instance, DEEP_ARCHIVE cannot be enabled. Otherwise, image pulling will fail. The DEEP_ARCHIVE objects need to be manually retrieved. This takes a long time, during which images are unavailable.
Impact of STANDARD_IA: When STANDARD_IA is used, data retrieval fees are incurred by pulling images for the first time (see COS Pricing).

Directions

Performing a dry run

1. Log in to the TCR console and click Garbage Collection in the left sidebar.
2. On the Garbage Collection page, you can view the list of garbage collection tasks in the current instance. If you need to switch to another instance, select from the Instance Name drop-down list at the top of the page.
3. Click Dry run and read the notes carefully.
Note:
In a dry run, the instance is fully scanned for unused data. You can estimate the cleanup range and the required time. During the dry run, the instance's basic features are not affected. You can still pull and push images. However, the intensive computing tasks of the cleanup may affect the speed of image pulling and push.
4. Click OK.

Running garbage collection

1. Log in to the TCR console and click Garbage Collection in the left sidebar.
2. On the Garbage Collection page, you can view the list of garbage collection tasks in the current instance. If you need to switch to another instance, select from the Instance Name drop-down list at the top of the page.
3. Click Run Garbage Collection and read the notes carefully.
Note:
During garbage collection, the instance is set to read-only mode. You can still pull images but cannot push images. The task execution time depends on the amount of artifact data in the instance and how long the instance has been in use. New instances created after May 22, 2026 are not subject to this restriction.
4. Click OK to immediately execute the cleanup task.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback