SSDs quietly do housekeeping in the background to stay fast and healthy, and the most important part of that is garbage collection. If you’ve ever wondered why an SSD sometimes writes slower right after you delete a lot of files, or why leaving the PC idle helps, garbage collection is the answer. Understanding it explains a lot of SSD behavior.

Why SSDs need garbage collection

NAND flash has an awkward rule: data is written in small “pages,” but it can only be erased in much larger “blocks” made up of many pages. You can’t overwrite a single page in place — the whole block must be erased first. Over time, blocks fill with a mix of valid data and stale (deleted) pages. Garbage collection is the process of consolidating the still-valid pages into fresh blocks and erasing the old blocks so they’re ready for fast new writes.

How it works step by step

The controller finds blocks that are mostly stale, copies the few remaining valid pages elsewhere, then erases the entire block. This frees clean blocks so future writes don’t have to stop and do this work mid-transfer. Ideally, garbage collection runs in the background during idle time, so you never notice it. Under sustained heavy writing with little free space, it may have to happen on demand, which is when you see slowdowns.

Garbage collection, TRIM, and write amplification

These three concepts are linked. TRIM is the command the operating system uses to tell the SSD which pages are truly deleted, so garbage collection knows they can be discarded rather than copied. Without TRIM, the drive might needlessly preserve dead data, doing more work. Copying valid pages around also causes write amplification — the drive physically writes more than the host asked — which garbage collection tries to minimize by choosing the emptiest blocks first.

Term What it does Who triggers it
Garbage collection Consolidates valid pages, erases stale blocks SSD controller
TRIM Marks deleted data so GC can skip it Operating system
Wear leveling Spreads writes evenly across blocks SSD controller
Over-provisioning Reserves spare blocks for GC headroom Firmware / user

How to keep garbage collection efficient

You don’t manage it directly, but you can help. Keep some free space — leaving roughly 10-20% of the drive empty gives garbage collection room to work and preserves the SLC cache. Make sure TRIM is enabled (it is by default in modern Windows, macOS, and Linux). Avoid filling the drive to the last few percent, which starves garbage collection and can drop write speeds dramatically. Leaving the PC on during light idle periods lets background collection catch up.

Why deletes can temporarily slow writes

Right after deleting many large files, the controller has extra stale pages to reclaim. If you immediately write a huge amount of new data, garbage collection may run on demand and compete with your transfer, causing a temporary dip. Give the drive a little idle time and speeds recover.

Signs garbage collection is falling behind

You rarely see garbage collection directly, but you can spot when it is struggling. The classic symptom is a drive that writes fast in short bursts but collapses to a fraction of its rated speed during long sustained transfers, because the controller has run out of pre-erased blocks and must reclaim them on demand. A nearly full drive makes this far worse, since there is little free space to work with. If you notice this pattern, free up space to get back toward 15-20% headroom, make sure TRIM is active, and give the drive some idle time. Performance usually recovers once background collection catches up and rebuilds a pool of clean blocks.

FAQ

Can I turn off garbage collection?

No, and you wouldn’t want to. It’s built into the SSD’s firmware and is essential to keeping the drive fast and extending its life. There’s no user setting to disable it, and disabling it would cripple performance.

Does garbage collection wear out my SSD faster?

It causes some extra writes (write amplification) by moving valid pages, but modern controllers, TRIM, and over-provisioning keep this efficient. The net effect extends usable performance far more than it costs in endurance for typical use.

Bottom line

Garbage collection is the SSD’s background cleanup that erases stale blocks so new writes stay fast, working hand in hand with TRIM, wear leveling, and over-provisioning. You can’t and shouldn’t disable it — just keep TRIM on, leave 10-20% free space, and don’t run the drive completely full. Do that and the housekeeping stays invisible.

Related guides

Browse all Storage & Memory guides →