Dynamically allocating memory for processes
US-9152549-B1 · Oct 6, 2015 · US
US9639399B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-9639399-B2 |
| Application number | US-201414246222-A |
| Country | US |
| Kind code | B2 |
| Filing date | Apr 7, 2014 |
| Priority date | Feb 1, 2013 |
| Publication date | May 2, 2017 |
| Grant date | May 2, 2017 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
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.
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
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
the resource being the memory · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.