TRIM is a command with the help of which the operating system can tell the SSD which blocks are no longer needed and can be deleted, or are marked as free for rewriting. With the TRIM command, it not only reduces the Write Amplifier Factor (WAF) but also boost the data access speeds.
Why TRIM Command?
While Flash-based devices are a block-level physical construction programmed into the controller, operating systems have their own organizational schemes—file systems. The SSD controller knows which blocks are in use and which are free, but doesn't know which blocks correspond to which files. Things get complicated when either the SSD or the OS deletes files.
How Does It Work?
TRIM command provides a bridge from the file level to the block level, giving the OS a way to tell the SSD that it’s deleting files and to mark those files being deleted to be removed during the next Garbage Collection run.
Without TRIM commands, Garbage Collection wouldn't know which files are deleted by the OS, so it continues to move pages containing the deleted data along with good pages, causing the increasing write amplification. This is where the TRIM command works. The SSD controller is told by TRIM to stop collecting pages with deleted data so that they get left behind and erased with the rest of the block.
TRIM commands can improve the Garbage Collection process, reduce the write amplification, and extend the life and performance of an SSD.