An image forming apparatus includes a memory that has a first storage area
for storing a control program and a second storage area for storing image
data and operates in a normal mode and a self-refresh mode. The image
forming apparatus stores the control program in the first storage area to
set the first storage area in the self-refresh mode, when the power
saving mode, stores image data which is stored in the second storage
area, in the storage medium to set the second storage area in a dormant
state, when the storage medium is connected to a main body in the power
saving mode, and sets at least a bank of the second storage area in which
the image data is stored, in the self-refresh mode and sets the remaining
bank in the dormant state, when the storage medium is not connected to
the main body in the power saving mode.