Since flash memory has a limited number of erase and write cycles this operation should be minimized when possible, but it is still a necessary part of an SSD’s operation.įigure 1: The garbage collection process. The writes from this step are not from the host system and are the source for increased write amplification in an SSD, meaning the flash in the SSD is being written more than what came from the host originally. Column three shows the data from pages A-D as well as E-H being written to a new block (Y), so the space from block X can be reclaimed by erasing it. To achieve this objective, the valid data in block X must be moved to a new block so that the original block can be erased to start over. Column two shows these changes and now block X is full, but is holding space for now invalid data (A-D) which cannot be reclaimed until the whole block is erased. At the same time, additional data is written to pages E-H. Sometime later that data is changed, so pages A-D are written and the original pages A-D are marked invalid (shown in column two). Column one shows pages A-D are written to block X. Only then can the invalid data in the original block be erased, making it ready for new valid data to be written. Therefore, to reclaim the space taken up by invalid data, all the valid data from one block must be first copied and written into the empty pages of a new block. Data can be written directly into an empty page, but only whole blocks can be erased. Flash memory is divided into blocks, which is further divided in pages. With SSDs, GC is the name for the process of relocating existing data to new locations and allowing the surrounding invalid data to be erased. Unlike hard disk drives (HDDs), NAND flash memory cannot overwrite existing data they must first erase old data before writing new data to the same location. In this article, we’ll look at how GC works, how it can be implemented, and how it relates to the TRIM command and over provisioning. Garbage collection (GC) is a fundamental process with all solid state drives (SSDs), but it can be implemented in different ways that can impact the overall SSD performance and endurance.
It’s importance cannot be understated for anyone venturing into today’s world of SSDs. ‘Garbage Collection in SSDs’ is a contributed article that was submitted by LSI and authored by Kent Smith, Senior Director of Product Marketing, Flash Components Division, LSI Corporation.