A method for controlling an information processing apparatus including a first storage unit in which an operating system that executes first and processes and first and second execution programs of the first and second processes are loaded, the method comprising:
- in a case where the information processing apparatus shifts into a power saving state in which power is not supplied to a device included in the information processing apparatus, storing, in a second storage unit of the information processing apparatus, execution status information of the operating system loaded in said first storage unit, execution status information of the first process, and execution status information of the second process;
- determining an order of restoring the first process and the second process based on a factor by which the information processing apparatus returns from the power saving state;
- in a case where the information processing apparatus returns from the power saving state, transferring the execution status information of the operating system from the second storage unit to the first storage unit, and restoring the operating system to a state of execution using the execution status information transferred to the first storage unit;
- and
- transferring, in accordance with the order determined in the determining step, the execution status information of the first process and the execution status information of the second process from the second storage unit to the first storage unit, restoring the first process to a state of execution using the execution status information of the first process transferred to the first storage unit before completion of transferring the execution status information of the second process, and restoring the second process to a state of execution using the execution status information of the second process transferred to the first storage unit after the first process has been restored,
- wherein the operating system includes a virtual memory function that divides a storage region of the first storage unit into pages, each page being a region that is a predetermined storage capacity, and uses the pages and a part of a storage region of the second storage unit as the storage region of the first storage unit based on a page table for each process for managing position information of a page that is used, and
- wherein the second storage unit stores the execution status information of the first process and the execution status information of the second process in units of pages.