Non-volatile memory systems, such as flash memory, have been widely adopted for use in consumer products. Flash memory may be found in different forms, for example in the form of a portable memory card that can be carried between host devices or as a solid state disk (SSD) embedded in a host device. When writing data to a conventional flash memory system, a host typically writes data to, and reads data from, addresses within a logical address space of the memory system. The memory system then commonly maps data between the logical address space (e.g. a logical block address (LBA)) and the physical blocks or metablocks of the memory, where data is stored in fixed logical groups corresponding to ranges in the logical address space. The host keeps track of the LBAs of its data files within the logical address space and the memory system may operate without knowledge of this mapping.
A drawback of memory systems that operate in a logical address space is fragmentation. Data written by a host file system may often be fragmented in logical address space, where many fixed logical groups are only partially updated with new data. The fragmentation may occur as a result of cumulative fragmentation of free space by the host file system, and possibly even as a result of inherent fragmentation of individual files by the host file system. When a memory device is fully fragmented, in order to improve performance the host may need to perform disk defragmentation in which the host reads the disk and re-writes each file in a sequential manner. The performance of a memory system may be degraded by increased fragmentation and frequent disk defragmentation. Disk defragmentation may be a long process that results in flash wear out and requires significant time/resources. Accordingly, hosts may refrain from performing defragmentation to avoid poor performance. Software solutions to more efficient defragmentation may occur at the file system level when a user schedules a time which the defragmentation software would run.