A memory system connectable to a host, comprising:
- a nonvolatile memory including a plurality of blocks;
- and
- a controller electrically connected to the nonvolatile memory and configured to receive a write command from the host, the write command including an identifier of write data and lifetime information of the write data, the lifetime information identifying a period to which an estimated lifetime of the write data belongs, the estimated lifetime being a lifetime of the write data, which is estimated by the host, wherein the controller is configured to:
- when the period identified by the lifetime information of the received write command is a first period, write the write data into a first write destination block allocated for a first block group for storing data having an estimated lifetime corresponding to the first period;
- when the period identified by the lifetime information of the received write command is a second period longer than the first period, write the write data into a second write destination block allocated for a second block group for storing data having an estimated lifetime corresponding to the second period;
- detect, of blocks which belong to the first block group, a first block containing data in which an elapsed time from a time point at which the data has been written to the first block is longer than the first period;
- notify the host of a first list of identifiers identifying valid data portions stored in the first block or a second list of identifiers identifying all data portions stored in the first block, wherein each of the valid data portions is data in which an elapsed time from a time point at which the data has been written to the first block is longer than the first period;
- in response to receiving a first copy request from the host after notifying the host of the first list or the second list, the first copy request specifying one or more valid data portions stored in the first block as copy target data and specifying the second block group as a copy destination block group, copy the one or more valid data portions specified as the copy target data from the first block to the second block group;
- and
- in response to receiving a first invalidation request from the host after notifying the host of the first list or the second list, the first invalidation request specifying one or more valid data portions stored in the first block as invalidation target data, invalidate the one or more valid data portions specified as the invalidation target data.