A Trim command
(commonly typeset as TRIM
) allows an operating system
to inform a solid-state drive
(SSD) which blocks of data are no longer considered in use and can be wiped internally.
Trim was introduced soon after SSDs started to become an affordable alternative to traditional hard disks
. Because low-level operation of SSDs differs significantly from hard drives
, the typical way in which operating systems handle operations like deletes and formats resulted in unanticipated progressive performance degradation of write operations on SSDs.
Trimming enables the SSD to handle garbage collection
overhead, which would otherwise significantly slow down future write operations to the involved blocks, in advance.
Although tools to "reset" some drives to a fresh state were already available before the introduction of trimming, they also delete all data on the drive, which makes them impractical to use for ongoing optimization.
By 2014 many SSDs had internal idle/background garbage collection mechanisms that work independently of trimming; although this successfully maintains their performance even under operating systems that do not support Trim, it has the associated drawbacks of increased write amplification
and wear of the flash cells.