Process running method and apparatus
AssigneeHuawei Technologies Co., Ltd.
InventorsDuo LIU, Yakun WANG, Kan ZHONG
Life of this patent
Estimating the term…
Abstract
A process running method and apparatus is disclosed. The method is: selecting a code page from a candidate process, storing only a code page of the candidate process into a swap partition, and releasing memory space occupied by the code page; updating a physical address that is of the code page and that is stored into a page entry; and when it is determined that the candidate process to which the code page belongs needs to be run, if the code page needs to be executed, directly executing the code page in the swap partition.
Claims14
A process running method, comprising:
- scanning processes in a memory, and selecting a candidate process from the processes;
- obtaining a code page from the selected candidate process, wherein the code page is used to store binary code or a shared library file of the process;
- writing the code page into a swap partition, and releasing storage space, in the memory, occupied by the code page;
- obtaining a physical address that is of the code page and that is stored in a page entry, and updating the physical address of the code page into a physical address for storing the code page in the swap partition, wherein the page entry is used to store a correspondence between a virtual address of the code page and the physical address of the code page;
- and
- executing, when the candidate process to which the code page belongs is running, the code page in the swap partition according to an updated correspondence that is stored in the page entry and that is between the virtual address and the physical address of the code page.
A process running apparatus, comprising:
- a storage storing instructions;
- and
- a processor coupled to the storage to execute the instructions to:
- scan processes in a memory;
- select a candidate process from the processes according to a result of scanning the processes in the memory;
- obtain a code page from the candidate process selected, wherein the code page is used to store binary code or a shared library file of the process;
- write the code page obtained into a swap partition;
- release storage space, in the memory, occupied;
- obtain a physical address that is of the code page and that is stored in a page entry;
- update the physical address that is of the code page and that is obtained into a physical address for storing the code page in the swap partition, wherein the page entry is used to store a correspondence between a virtual address of the code page and the physical address of the code page;
- and
- when the candidate process to which the code page belongs is running, execute the code page in the swap partition according to a correspondence that is stored in the page entry, that is updated, and that is between the virtual address and the physical address of the code page.
Dependencies are inferred from the claim text.