Method, apparatus and terminal for releasing memory

US9639399B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9639399-B2
Application numberUS-201414246222-A
CountryUS
Kind codeB2
Filing dateApr 7, 2014
Priority dateFeb 1, 2013
Publication dateMay 2, 2017
Grant dateMay 2, 2017

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.

A method is provided for memory releasing. The method includes obtaining a first memory space value of a terminal system, where the first memory space represents a size of current idle memory space on the terminal system. The method also includes requesting a memory space whose size equals to a second memory space value from the terminal system, where the second memory space value is greater than the first memory space value. Further, the method includes releasing occupied memory after the terminal system receives a memory space request and detects that the second memory space value is greater than the first memory space value. The method includes confirming allocation of the memory space whose size equals to the second memory space value. The method includes releasing the memory space whose size equals to the second memory space value as the idle memory space after receiving allocation confirmation of the memory space of the terminal system.

First claim

Opening claim text (preview).

What is claimed is: 1. A method for releasing memory, comprising: obtaining, by an application program without requesting permissions from a system kernel level API (Application Programming Interface) controlling memory releasing in a terminal system, a first memory space value of the terminal system, wherein the first memory space value represents a total size of current idle memory space on the terminal system, and the application program is a user-installed non-system program; requesting, by the application program, a memory space whose size equals to a second memory space value from the terminal system, wherein the second memory space value is greater than the first memory space value; after receiving the memory space request and detecting that the second memory space value is greater than the first memory space value, releasing, by the terminal system, certain occupied memory; confirming, by the terminal system, allocation of the memory space whose size equals to the second memory space value; receiving, by the application program, the allocation of the memory space directed to the application program from the terminal system, wherein a size of the allocation equals to the second memory space; and after receiving allocation confirmation of the memory space of the terminal system, releasing, by the application program, the memory space whose size equals to the second memory space value allocated for the application program into the current idle memory space, wherein before requesting the memory space whose size equals to the second memory space value from the terminal system, the method further comprises: identifying system programs and non-system programs, wherein system programs are kernel level programs that control an operation of the terminal system, and non-system programs are user-installed programs that do not control system operations; obtaining a third memory space value, wherein the third memory space value represents a memory space that is occupied by non-system programs and unused for a preset time period; and obtaining the second memory space value by multiplying a sum of the first memory space value and the third memory space value by a preset ratio, wherein the preset ratio is determined according to the first memory space and the third memory space, to produce a multiplication result greater than the first memory space value. 2. The method according to claim 1 , further including: obtaining a total number of low memory warnings sent out from the terminal system; and obtaining the preset ratio based on the first memory space value, the third memory space value, and the number of low memory warnings. 3. The method according to claim 2 , further including: performing multiple trials for setting the preset ratio based on the first memory space value, the third memory space value and the number of low memory warnings. 4. The method according to claim 3 , wherein: when the number of low memory warnings sent out by the terminal system exceeds a preset number, the terminal system forces the program that requests memory space from the terminal system to close; and when the number of low memory warnings sent out by the terminal system is less than the preset number, the preset ratio is calculated by the second memory space value with respect to the sum of the first memory space value and the third memory space value. 5. The method according to claim 1 , wherein: the memory space whose size equals to the second memory space value is requested from the terminal system through multiple processes configured in a program that is used for requesting the memory space, when the terminal system limits the size of the memory space that can be requested by each process. 6. The method according to claim 1 , after receiving allocation confirmation of the memory space of the terminal system and releasing the memory space whose size equals to the second memory space value, further including: re-calculating the first memory space value of the terminal system; detecting that the re-calculated first memory space value meets a preset condition; and when the re-calculated first memory space value meets the preset condition, requesting the memory space whose size equals to the second memory space value from the terminal system again. 7. The method according to claim 6 , wherein the preset condition includes at least one of two conditions: the re-calculated first memory space value is less than a preset first threshold value; and the difference between the re-calculated first memory space value and the previous obtained first memory space value is greater than a preset second threshold value. 8. An apparatus for releasing memory, comprising one or more processors executing an application program to release memory, the one or more processors being configured to: obtain a first memory space value of a terminal system without requesting permissions from a system kernel level API (Application Programming Interface) to release memory space in the terminal system, wherein the first memory space value represents a total size of current idle memory space on the terminal system, and the application program is a user-installed non-system program; request a memory space whose size equals to a second memory space value from the terminal system; wherein: the second memory space value is greater than the first memory space value; after the terminal system receives the memory space request and detects that the second memory space value is greater than the first memory space value, the terminal system releases certain occupied memory; and after the occupied memory is released, the terminal system confirms allocation of the memory space whose size equals to the second memory space value; receive, from the terminal system, the allocation of the memory space directed to the application program, wherein a size of the allocation equals to the second memory space; and after receiving allocation confirmation of the memory space of the terminal system, release the memory space whose size equals to the second memory space value allocated for the application program into the current idle memory space; wherein the one or more processors are further configured to execute the application program to: before the application program requests the memory space whose size equals to the second memory space value from the terminal system, identify system programs and non-system programs, wherein system programs are kernel-level programs that control an operation of the terminal system, and non-system programs are user-installed programs that do not control system operations; and obtain a third memory space value, wherein the third memory space value represents a size of a memory space that is occupied by non-system programs and unused for a preset time period; and obtain the second memory space value by multiplying a sum of the first memory space value and the third memory space value by a preset ratio, wherein: the preset ratio is determined according to the first memory space and the third memory space, to produce a multiplication result greater than the first memory space value. 9. The apparatus according to claim 8 , wherein the one or more processors are further configured to execute the application program to: before the application program obtains the second memory space value, obtain a total number of low memory warnings sent out from the terminal system; and obtain the preset ratio based on the first memory space value, the third memory space value and the number of low memory warnings. 10. The apparatus according to claim 9 , wherein the one or more processors are further configured to: perform multiple trial

Assignees

Inventors

Classifications

  • Mechanisms to release resources · CPC title

  • User address space allocation, e.g. contiguous or non contiguous base addressing · CPC title

  • Details relating to dynamic memory management · CPC title

  • G06F9/5016Primary

    the resource being the memory · 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 US9639399B2 cover?
A method is provided for memory releasing. The method includes obtaining a first memory space value of a terminal system, where the first memory space represents a size of current idle memory space on the terminal system. The method also includes requesting a memory space whose size equals to a second memory space value from the terminal system, where the second memory space value is greater th…
Who is the assignee on this patent?
Tencent Tech Shenzhen Co Ltd
What technology area does this patent fall under?
Primary CPC classification G06F12/0223. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue May 02 2017 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 1 related publication on this page (citations in our corpus or others sharing the same primary CPC).