Patent ID: 8856475

Claim:
A method for storing data in a memory that includes multiple memory blocks, the method comprising: selecting one or more memory blocks for compaction, wherein each one of the one or more memory blocks includes both valid data and invalid data; determining a number of accesses of each logical address for each memory block of the one or more memory blocks; determining one or more frequently-accessed logical addresses of each memory block of the one or more memory blocks dependent upon the number of accesses of each logical address; identifying at least one of the one or more memory blocks responsive to a determination that a ratio of a number of the one or more frequently-accessed logical addresses of the at least one of one or more memory blocks and a total number of valid logical addresses in the at least one of the one or more memory blocks is greater than a predetermined threshold; and compacting the selected one or more memory blocks excluding the identified at least one of the one or more memory blocks.