Memory processing method and device and storage medium

US10698837B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-10698837-B2
Application numberUS-201816138439-A
CountryUS
Kind codeB2
Filing dateSep 21, 2018
Priority dateDec 29, 2017
Publication dateJun 30, 2020
Grant dateJun 30, 2020

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

The disclosure relates to a method for processing a memory and apparatus, an electronic device, and a computer-readable storage medium. The method includes acquiring reclaimable memory pages occupied by an application to be processed; acquiring an idle duration of the application to be processed for each reclaimable memory page; determining a duration threshold according to the idle durations for the reclaimable memory pages; and selecting from the reclaimable memory pages a memory page for which the idle duration exceeds the duration threshold and reclaiming the memory page. The above-mentioned method for processing a memory and apparatus, electronic device and computer-readable storage medium may minimize the adverse impact on each application, thereby maintaining the balance between reclaiming and operation of an application memory to be processed.

First claim

Opening claim text (preview).

The invention claimed is: 1. A method for processing a memory, the method being carried out by an electronic device, and comprising: acquiring a plurality of reclaimable memory pages occupied by an application to be processed; acquiring an idle duration of the application to be processed for each reclaimable memory page; acquiring correspondences between re-starting durations and reclaiming proportions corresponding to the application to be processed, the re-starting duration being a duration for restarting the application to be processed after the reclaiming proportion of the reclaimable memory pages occupied by the application to be processed are reclaimed; determining a reclaiming proportion of reclaimable memory pages according to the correspondences between reclaiming proportions and re-starting durations; determining a reclaiming number according to the reclaiming proportion and the total number of the reclaimable memory pages; selecting the Kth-largest idle duration from the idle durations for the plurality of reclaimable memory pages according to the reclaiming number, and taking the Kth-largest idle duration as a duration threshold, the number of reclaimable memory pages each having an idle duration greater than the Kth-largest idle duration being the reclaiming number, K being a natural number not greater than the reclaiming number; and reclaiming at least one memory page, for which the idle duration exceeds the duration threshold, of the plurality of reclaimable memory pages. 2. The method of claim 1 , wherein the acquiring an idle duration of the application to be processed for each reclaimable memory page comprises: acquiring update time recorded by a timestamp of each reclaimable memory page, the update time indicating time when the reclaimable memory page was used most recently; and calculating an idle duration for the reclaimable memory page according to the update time. 3. The method of claim 2 , wherein the acquiring update time recorded by a timestamp of each reclaimable memory page comprises: for each reclaimable memory page, creating, by a resource priority and limitation management module in the electronic device, a timestamp for recording an update time of the reclaimable memory page; and in responsive to that use of the reclaimable memory page is detected, updating the time stamp for the reclaimable memory page. 4. The method of claim 3 , wherein the use of the reclaimable memory page is detected when at least one of allocation of the reclaimable memory page, recovery of the reclaimable memory page, release of the reclaimable memory page, or querying of using condition of a cache in a processor of the electronic device is detected. 5. The method of claim 1 , wherein the acquiring an idle duration of the application to be processed for each reclaimable memory page comprises: providing a Least Recently Used (LRU) management unit in a memory management unit or a cache unit in a processor of the electronic device; recording, by the LRU management unit, a plurality of memory addresses and update time of each memory address; acquiring an update time of each of the plurality of reclaimable memory pages according to an update time of a memory address corresponding to the reclaimable memory page; and calculating an idle duration for the reclaimable memory page according to the update time of the reclaimable memory page. 6. The method of claim 1 , wherein the acquiring a plurality of reclaimable memory pages occupied by an application to be processed comprises: traversing a plurality of memory-mapped files of the application to be processed; querying, in the plurality of memory-mapped files, all memory pages occupied by the application to be processed; and eliminating a memory page carrying an occupation mark from all the memory pages to acquire reclaimable memory pages from memory pages other than the eliminated memory page. 7. The method of claim 1 , wherein before the acquiring a plurality of reclaimable memory pages occupied by an application to be processed, the method further comprises: detecting whether a foreground application depends on the application to be processed; if a foreground application depends on the application to be processed, adjusting the priority of the application to be processed to match the foreground application; and if a foreground application does not depend on the application to be processed, performing the operation of acquiring reclaimable memory pages occupied by an application to be processed. 8. An electronic device comprising a storage having stored thereon a computer program and a processor, the storage having stored thereon a computer program that when executed by the processor causes the processor to perform operations of: acquiring a plurality of reclaimable memory pages occupied by an application to be processed; acquiring an idle duration of the application to be processed for each reclaimable memory page; acquiring correspondences between re-starting durations and reclaiming proportions corresponding to the application to be processed, the re-starting duration being a duration for restarting the application to be processed after the reclaiming proportion of the reclaimable memory pages occupied by the application to be processed are reclaimed; determining a reclaiming proportion of reclaimable memory pages according to the correspondences between reclaiming proportions and re-starting durations; determining a reclaiming number according to the reclaiming proportion and the total number of the reclaimable memory pages; selecting the Kth-largest idle duration from the idle durations for the plurality of reclaimable memory pages according to the reclaiming number, and taking the Kth-largest idle duration as a duration threshold, the number of reclaimable memory pages each having an idle duration greater than the Kth-largest idle duration being the reclaiming number, K being a natural number not greater than the reclaiming number; and reclaiming at least one memory page, for which the idle duration exceeds the duration threshold, of the plurality of reclaimable memory pages. 9. The electronic device of claim 8 , wherein the acquiring an idle duration of the application to be processed for each reclaimable memory page comprises: acquiring update time recorded by a timestamp of each reclaimable memory page, the update time indicating time when the reclaimable memory page was used most recently; and calculating an idle duration for the reclaimable memory page according to the update time. 10. The electronic device of claim 9 , wherein the acquiring update time recorded by a timestamp of each reclaimable memory page comprises: for each reclaimable memory page, creating, by a resource priority and limitation management module in the electronic device, a timestamp for recording an update time of the reclaimable memory page; and in responsive to that use of the reclaimable memory page is detected, updating the time stamp for the reclaimable memory page. 11. The electronic device of claim 10 , wherein the use of the reclaimable memory page is detected when at least one of allocation of the reclaimable memory page, recovery of the reclaimable memory page, release of the reclaimable memory page, or querying of using condition of a cache in a processor of the electronic device is detected. 12. The electronic device of claim 8 , wherein the acquiring an idle duration of the application to be processed for each reclaimable memory page comprises: providing a Least Recently Used (LRU) management unit in a memory management unit or a cache unit in a processor of the electronic device; recording

Assignees

Inventors

Classifications

  • Garbage collection, i.e. reclamation of unreferenced memory · CPC title

  • G06F9/5022Primary

    Mechanisms to release resources · CPC title

  • with age lists, e.g. queue, most recently used [MRU] list or least recently used [LRU] list · CPC title

  • by assessing time · CPC title

  • using adaptive policy · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US10698837B2 cover?
The disclosure relates to a method for processing a memory and apparatus, an electronic device, and a computer-readable storage medium. The method includes acquiring reclaimable memory pages occupied by an application to be processed; acquiring an idle duration of the application to be processed for each reclaimable memory page; determining a duration threshold according to the idle durations f…
Who is the assignee on this patent?
Guangdong Oppo Mobile Telecommunications Corp Ltd
What technology area does this patent fall under?
Primary CPC classification G06F9/5022. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jun 30 2020 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 9 related publications on this page (citations in our corpus or others sharing the same primary CPC).