Simple Questions: What Is TRIM For SSDs & Why Is It Useful?

In the last couple of years, solid state drives have increasingly gained popularity. It's also very probable that you've read or at least heard a more technical friend talking about how fast a SSD (Solid State Drive) is when compared to traditional hard drives. If you are already using or you want to buy an SSD in order to improve your computer's performance you should know that TRIM support is important. What is TRIM and why does it matter in the context of SSDs? You can find the answers to these questions in this guide:

What Is TRIM & What Does It Do?

In order to understand what TRIM is and what it does, you first need to know how SSDs work and how they handle the information stored on them.

Image source: SSD Guide.

A solid state drive is nothing more than a device full of flash memory chips. The operating system needs to be able to read and manipulate the data on these chips. In order to do that, the SSD has to have a way to arrange this data. Information stored on a SSD is divided into blocks of data. These blocks are, in turn, divided into pages of data. To better exemplify, imagine that the SSD is a library. The library has lots of shelves and these shelves are filled with books.

But what happens when you no longer want to keep one of these books? Say you want to sell it or lend it to a friend. It would seem obvious that you only have to take the book out of that shelf. Well, if your library would be a solid state drive, things wouldn't work that way. On a SSD, if you decide to delete some data, it wouldn't matter if it only occupies a page from a block. The whole block would need to be deleted! All the information on the other pages would move to a temporary buffer memory, then put back on the original block. It's like emptying a whole shelf from your library whenever you want to take a book out or replacing it with a new one. Then, you would have to put all the other books back in their places. Not very efficient, right?

To draw a conclusion, in order for a solid state drive to write new data on a previously occupied space, it first has to wipe it completely. Doing it every time you move or delete data on your SSD translates into poor performance in terms of data writing speeds.

This is where TRIM steps in. TRIM is a command that helps the operating system know exactly where the data you want to move or delete is stored. That way, the solid state drive can access only the pages holding the data. Furthermore, whenever a delete command is issued by the user or the operating system, the TRIM command immediately wipes the pages or blocks where the files are stored. This means that, the next time the operating system tries to write new data in that area, it won't have to wait to first delete it.

Why TRIM Is Useful?

You already know by now that when deleting and rewriting data, a solid state drive that doesn't use TRIM has to partially move large pieces of information, wipe out all the block(s) containing it and, finally, write the new data onto those blocks. On one hand, this means your device will fare poorly in terms of performance. On the other hand, it means the SSD will do lots of erase and rewrite actions. These will pile up and will cause a fast wear of the flash memory chips that are found inside the SSD.

TRIM ensures that both these issues are prevented, by eliminating the need to constantly erase and rewrite large chunks of memory. Instead of managing whole blocks, a TRIM enabled SSD can work with the smaller memory clusters called pages. Even more, whenever a delete command is issued by the operating system or the user, the SSD automatically sends a TRIM command to immediately wipe the storage space being erased. This ensures a faster writing speed when new data will be stored in that area.

Conclusion

Solid state drives offer lots of performance. When it comes to their read or write speeds, they are much faster than traditional hard drives. However, because of the way they work with data, SSDs must use specific firmware commands in order to prevent excessive wear and performance degradation. Now you know why TRIM is important and what it does. So when you'll decide to buy a SSD, don't forget to check if it supports TRIM.