Patent attributes
According to one embodiment, a memory system includes a nonvolatile memory, detection unit, management unit, selection unit, and garbage collection unit. The nonvolatile memory includes memory areas divided into units of execution of garbage collection. The detection unit detects a data amount of data written to a different memory area among the memory areas when the garbage collection is executed, for each of the memory areas. The management unit manages a threshold set for each of the memory areas. The selection unit selects, based on the data amount and the threshold for each of the memory areas, a memory area whose data amount is smaller than the threshold of the memory area. The garbage collection unit executes the garbage collection on the memory area selected by the selection unit.