Method and device for processing reclaimable memory pages, and storage medium
AssigneeGuangdong Oppo Mobile Telecommunications Corp., Ltd.
InventorsPan Fang, Yan Chen
Life of this patent
Estimating the term…
Abstract
A method and device for processing a memory, and a computer-readable storage medium are provided. In the method, reclaimable memory pages occupied by an application to be processed are determined, a reclaiming proportion corresponding to the application to be processed is determined, a reclaiming number is determined according to the reclaimable memory pages and the reclaiming proportion, and the reclaiming number of memory pages from the reclaimable memory pages are selected and reclaimed.
Claims15
A method for processing a memory, the method being carried out in an electronic device and comprising:
- determining a plurality of reclaimable memory pages occupied by an application to be processed, comprising:
- determining all memory pages occupied by the application to be processed by querying a memory occupied by the application to be processed;
- and
- determining as the plurality of reclaimable memory pages of the all memory pages except at least one particular memory page, wherein data stored on each of the at least one particular memory page is being used by the application to be processed or is data necessary for keeping normal running of the application to be processed;
- determining a reclaiming portion corresponding to the application to be processed, wherein the reclaiming proportion represents a proportion of memory pages to be reclaimed in the plurality of reclaimable memory pages;
- determining a reclaiming number according to the plurality of reclaimable memory pages and the reclaiming proportion;
- and
- selecting the reclaiming number of reclaimable memory pages from the plurality of reclaimable memory pages and reclaiming the reclaiming number of memory pages,
- wherein the determining a reclaiming proportion corresponding to the application to be processed comprises;
- determining restarting durations and an application type of the application to be processed, the application type indicating correspondences between restarting durations for the application to be processed and reclaiming proportions, each restarting duration indicating a duration taken for restarting the application to be processed after a reclaiming proportion of the plurality of reclaimable memory pages of the application to be processed is reclaimed;
- and
- determining a reclaiming proportion corresponding to the application to be processed according to a reclaiming model corresponding to the application type.
An electronic device, comprising a memory and a processor, the memory storing a computer program that when executed by the processor, causes the processor to perform:
- determining a plurality of reclaimable memory pages occupied by an application to be processed, comprising:
- determining all memory pages occupied by the application to be processed by querying a memory, occupied by the application to be processed;
- and
- determining as the plurality of reclaimable memory pages the all memory pages except at least one particular memory page, wherein data stored on each of the at least one particular memory page is being used by the application to be processed or is data necessary for keeping normal running of the application to be processed;
- determining a reclaiming proportion corresponding to the application to be processed, wherein the reclaiming proportion represents a proportion of memory pages to be reclaimed in the plurality of reclaimable memory pages;
- determining a reclaiming number according to the plurality of reclaimable memory pages and the reclaiming proportion;
- and
- selecting the reclaiming number of reclaimable memory pages from the plurality of reclaimable memory pages and reclaiming the reclaiming number of memory pages;
- wherein the determining a reclaiming proportion corresponding to the application to be processed comprises;
- determining restarting durations and an application type of the application to be processed, the application type indicating correspondences between restating durations for the application to be processed and reclaiming proportions, each restarting duration indicating a duration taken for restarting the application to be processed after a reclaiming proportion of the plurality of reclaimable memory pages of the application to be processed is reclaimed;
- and
- determining a reclaiming proportion corresponding to the application to be processed according to a reclaiming model corresponding to the application type.
A non-transitory computer-readable storage medium having stored thereon a computer program that when executed by a processor, causes the processor to perform a method, the method comprising:
- determining a plurality of reclaimable memory pages occupied by an application to be processed, comprising:
- determining all memory pages occupied by the application to be processed by querying a memory occupied by the application to be processed;
- and
- determining as the plurality of reclaimable memory pages the all memory pages except at least one particular memory page, wherein data stored on each of the at least one particular memory page is being used by the application to be processed or is data necessary for keeping normal running of the application to be processed;
- determining a reclaiming proportion corresponding to the application to be processed, wherein the reclaiming proportion represents a proportion of memory pages to be reclaimed in the plurality of reclaimable memory pages;
- determining a reclaiming number according to the plurality of reclaimable memory pages and the reclaiming proportion;
- and
- selecting the reclaiming number of reclaimable memory pages from the plurality of reclaimable memory pages and reclaiming the reclaiming number of memory pages,
- wherein the determining a reclaiming proportion corresponding to the application to be processed comprises;
- determining restarting durations and an application type of the application to be processed, the application type indicating correspondences between restarting durations for the application to be processed and reclaiming proportions, each restarting duration indicating a duration taken for restarting the application to be processed after a reclaiming proportion of the plurality of reclaimable memory pages of the application to be processed is reclaimed;
- and
- determining a reclaiming proportion corresponding to the application to be processed according to a reclaiming model corresponding to the application type.
Dependencies are inferred from the claim text.