BACKGROUND OF THE DISCLOSURE

Field of the Disclosure

The aspect of the embodiments relates to an image forming apparatus and a method of controlling the image forming apparatus.

Description of the Related Art

There are semiconductor storage devices, each including a flash memory and a control circuit, used for an embedded device. Examples of the flash memory include a solid state drive (SSD) and an embedded Multi Media Card (eMMC). Such a semiconductor storage device has better performance, for example, in access speed and quietness than a hard disk drive (HDD). On the other hand, the number of times that data is rewritable to such a semiconductor storage device is limited.

Thus, a controller of a semiconductor storage device performs distribution data writing referred to as wear leveling to increase a life of flash memory built in the semiconductor storage device. In the wear leveling, data writing is performed into different blocks so as to use blocks with the smaller number of writing times, as much as possible. Accordingly, when wear leveling processing is executed in the semiconductor storage device, block erasing and data copying occur during block changing. Therefore, performance (reading and writing performance) of the semiconductor storage device may decrease.

In a nonvolatile semiconductor storage device, processing referred to as TRIM is generally executed as a method of improving the decrease in performance. The TRIM is a command that notifies a storage device of storage areas that become unnecessary for a file system of an operating system (OS).

More specifically, a command referred to as TRIM is used to notify a controller of a semiconductor storage device of areas that become unused. Since the controller of the semiconductor storage device recognizes the unused areas, the controller collects only areas that are being used (garbage collection), and performs wear leveling. Thus, an amount of copied data decreases, the number of used blocks decreases, and the total number of times of data writing decreases. As a result, since a TRIM command notifies a semiconductor storage device of storage areas that become unnecessary, wear leveling processing does not need to be performed for unnecessary areas, and performance of the semiconductor storage device less decreases.

As an example of a timing at which Trim processing is executed with a TRIM command, an image forming apparatus obtains a job status of a print job, and executes a TRIM command that can be used for wear leveling if the image forming apparatus determines that the job status is in a status that represents an interruption of the print job, which is discussed in Japanese Patent Application Laid-Open No. 2015-141681.

SUMMARY OF THE DISCLOSURE

According to an aspect of the embodiments, an image forming apparatus includes a sensor configured to detect an original, a nonvolatile storage that includes a semiconductor area, and a controller configured to execute a setting for dividing the semiconductor area into a plurality of areas, and execute Trim processing on the divided areas in response to passing of a predetermined time period while the image forming apparatus is in a standby state, wherein the controller is configured to stop the Trim processing based on a detection of the original detected by the sensor while the Trim processing is executed.

Further features of the disclosure will become apparent from the following description of exemplary embodiments with reference to the attached drawings.

