CN104111873B - Memory release method and system - Google Patents
Memory release method and system Download PDFInfo
- Publication number
- CN104111873B CN104111873B CN201310139927.9A CN201310139927A CN104111873B CN 104111873 B CN104111873 B CN 104111873B CN 201310139927 A CN201310139927 A CN 201310139927A CN 104111873 B CN104111873 B CN 104111873B
- Authority
- CN
- China
- Prior art keywords
- program
- memory
- electronic device
- priority
- priority limit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Stored Programmes (AREA)
- Memory System (AREA)
Abstract
The present invention provides a kind of memory release method, and the method comprising the steps of: being associated between the residual capacity of memory and the affiliated priority limit of program in electronic device is arranged;The current remaining capacity of memory is obtained every a preset first time interval;When electronic device needs releasing memory, according to the current remaining capacity of memory and the association, priority limit belonging to the theory for the program that electronic device to be discharged is determined;According to whether there is the program being currently running in the affiliated priority limit of above-mentioned theory, priority limit belonging to the electronic device program reality currently to be discharged is determined;The maximum program of committed memory capacity is found out in the program being currently running corresponding to the priority limit belonging to the reality;And the release maximum program of committed memory capacity.The present invention also provides a kind of memories to discharge system.The present invention can discharge the memory of electronic device in electronic device memory residual capacity deficiency.
Description
Technical field
The present invention relates to a kind of EMS memory management process and systems, especially with respect to a kind of method in memory release and are
System.
Background technique
With the fast development of the technologies such as electronics, communication, smart phone, if Android (Android) mobile phone is in mobile phone market
Share it is higher and higher.Considering based on cost, in the design, production process of smart phone, it is low in save as control mobile phone at
This usual way.However, low memory mobile phone, standby or after a period of use, reaction speed can be slack-off, sometimes very
To the phenomenon that will appear stuck (not reacting for a long time).When user is such issues that encounter, it is often necessary to restart mobile phone, therefore
Cause poor user experience.For such problem, currently used solution are as follows: a release mobile phone EMS memory is installed in mobile phone
Software, run the software manually when user's sensory system is slow to improve mobile phones condition.The solution needs to use
The manual runs software in family causes not convenient in user's use.
Summary of the invention
In view of the foregoing, it is necessary to a kind of memory release method and system are provided, can in an electronic memory it is surplus
Automatically the memory of electronic device is discharged when remaining off-capacity.
A kind of memory release method is applied in electronic device, and the method comprising the steps of :(a) the remaining of memory is arranged and holds
It measures and being associated between the affiliated priority limit of program in electronic device;(b) it is obtained every a preset first time interval
The current remaining capacity of memory;(c) when electronic device needs releasing memory, according to the current remaining capacity of memory and the pass
Connection, determines priority limit belonging to the theory for the program that electronic device to be discharged;(d) according to the affiliated priority limit of above-mentioned theory
In with the presence or absence of the program that is currently running, determine priority limit belonging to the electronic device program reality currently to be discharged;(e) exist
The maximum program of committed memory capacity is found out in the program being currently running corresponding to priority limit belonging to the reality;And
(f) the maximum program of committed memory capacity is discharged.
A kind of memory release system, runs in electronic device, which includes: setup module, for memory to be arranged
Being associated between residual capacity and the affiliated priority limit of program in electronic device;Module is obtained, for preset every one
The current remaining capacity of first time interval acquisition memory;Determining module, for when electronic device needs releasing memory, according to
The current remaining capacity of memory and the association, determine priority limit belonging to the theory for the program that electronic device to be discharged;Sentence
Cover half block, for according to, with the presence or absence of the program being currently running, judgement electronic device is worked as in the affiliated priority limit of above-mentioned theory
Before priority limit belonging to the program reality to be discharged;Module is found, for corresponding to the priority limit belonging to the reality
The program being currently running in find out the maximum program of committed memory capacity;And release module, for discharging the committed memory
The maximum program of capacity.
Compared to the prior art, memory release method provided by the invention and system, every a preset time interval
The current internal storage state of electronic device is obtained, and in the memory residual capacity deficiency of electronic device, discharges the interior of electronic device
It deposits, electronic device can be effectively prevented and phenomena such as reaction speed can be slack-off or stuck occur, to improve user experience.
Detailed description of the invention
Fig. 1 is the hardware architecture diagram of memory release system preferred embodiment of the present invention.
Fig. 2 is the operation process chart of memory release method preferred embodiment of the present invention.
Fig. 3 is that memory release method preferred embodiment of the present invention determines belonging to the electronic device program reality currently to be discharged
The sub-process figure of priority limit.
Main element symbol description
Electronic device | 100 |
Memory discharges system | 10 |
Setup module | 11 |
Obtain module | 12 |
Determining module | 13 |
Determination module | 14 |
Find module | 15 |
Release module | 16 |
Storage unit | 20 |
Memory | 30 |
Program | 40 |
The present invention that the following detailed description will be further explained with reference to the above drawings.
Specific embodiment
As shown in fig.1, being the hardware architecture diagram of memory release system preferred embodiment of the present invention.The memory discharges system
10 run in electronic device 100, which can be smart phone, tablet computer, palm PC (Personal
Digital Assistant, PDA) etc..The electronic device 100 further includes component, such as storage unit 20, memory 30 and program
40.The component 10-40 of electronic device is communicated by system bus.The memory release system 10 is for obtaining memory 30
Residual capacity, and when the residual capacity of memory 30 is lower than a preset capacity threshold values, a program 40 is chosen to discharge the choosing
The program 40 taken.The program 40 of the selection can be foreground program or background program.The storage unit 20 is for storing electronics
Data in device 100.
The memory discharges system 10 and includes setup module 11, obtain module 12, determining module 13, determination module 14, find
Module 15 and release module 16.Module 11-16 includes computerization program instruction.
Setup module 11 is used to be arranged priority limit belonging to program 40 in the residual capacity and electronic device 100 of memory 30
Between association.Each program 40 is corresponding with a priority in electronic device 100, and the priority is for identifying program 40
Importance.In the present embodiment, the corresponding numerical value of priority is bigger, then the importance of read-me 40 is lower, wherein running background
The priority of program 40 be both greater than 0, the priority of the program 40 of front stage operation is equal to 0.
In the present embodiment, it is described association may include: when memory 30 residual capacity less than the first preset threshold (such as
40000000 (M)) and when being greater than or equal to the second preset threshold (such as 16M), priority limit belonging to program 40 in electronic device 100
More than or equal to the first pre-set priority (such as 15);When the residual capacity of memory 30 is less than the second preset threshold (such as 16M)
And when being greater than or equal to third preset threshold (such as 8M), priority limit belonging to program 40 is greater than or waits in electronic device 100
In the second pre-set priority (such as 7);When the residual capacity of memory 30 is less than third preset threshold (such as 8M) and is greater than or waits
When the 4th preset threshold (such as 3M), priority limit belonging to program 40 is default more than or equal to third in electronic device 100
Priority (such as 1);When the residual capacity of memory 30 is less than the 4th preset threshold (such as 3M) and default more than or equal to the 5th
When threshold values (such as 0M), priority limit belonging to program 40 is greater than the 4th pre-set priority (such as 0) in electronic device 100.
Module 12 is obtained to be used to obtain the current remaining capacity of memory 30 every a preset first time interval.It is described
First time interval is by user or systemic presupposition, for example 50 milliseconds (ms).
When electronic device 100 needs releasing memory 30, determining module 13 is used for the current remaining capacity according to memory 30
And the association, determine priority limit belonging to the theory for the program 40 that electronic device 100 to be discharged.For example, if memory 30
Current remaining capacity is 30M, is less than first preset threshold and is greater than second preset threshold, it is determined that module 13 determines
Priority limit belonging to 40 theory of program to be discharged of electronic device 100 is greater than or equal to 15.It should be noted that working as memory 30
Residual capacity be less than first preset threshold, and electronic device 100 currently without program 40 release when, then illustrate electronics
Device 100 needs releasing memory 30.
Determination module 14 is used to sentence according to whether there is the program 40 being currently running in the affiliated priority limit of above-mentioned theory
Determine priority limit belonging to 40 reality of program that electronic device 100 currently to be discharged.
In the preferred embodiment, when there is the program 40 being currently running in priority limit belonging to the theory, sentence
Cover half block 14 determines that priority limit belonging to 40 reality of program currently to be discharged is priority limit belonging to the theory.
There is no the programs 40 being currently running in priority limit belonging to the theory, and bulk memory is not present in electronic device 100,
However, there is (i.e. the program of running background) when the priority being currently running is greater than 0 program 40 in electronic device 100, determine
Module 14 determines that priority limit belonging to 40 reality of program currently to be discharged is greater than 0.It is preferential belonging to the theory
There is no the programs 40 being currently running in grade range, and there is no bulk memories and electronic device 100 to exist for electronic device 100
There is no when the program 40 that the priority being currently running is greater than 0 in one preset second time interval, determination module 14 is sentenced
Priority limit belonging to fixed 40 reality of program currently to be discharged is equal to the 0(i.e. program of front stage operation).Described second
Time interval is by user or systemic presupposition, for example 500ms.
It should be noted that memory 30 is managed in electronic device 100 using memory pool, the memory in the memory pool
30 are divided into bulk memory and fritter memory.The bulk memory refers to that memory size is greater than or equal to a preset capacity (example
Such as the memory 30 of 32 kilobytes (kb)).When in electronic device 100 there are when bulk memory, even if the residual capacity of memory 30 is not
Greatly, but in electronic device 100 still there is available memory 30, at this point, electronic device 100 does not have to releasing memory 30.
It finds in program 40 of the module 15 for being currently running corresponding to the priority limit belonging to the reality and finds out
The maximum program 40 of committed memory capacity.
Release module 16 is used for by the maximum record of program 40 of the committed memory capacity into storage unit 20, and discharging should
The maximum program 40 of committed memory capacity.
In the present invention, when the residual capacity of memory 30 is lower than some preset threshold, but corresponding to the preset threshold
It, will be according to bulk memory in electronic device 100 in priority limit belonging to theory and when the program 40 being currently running is not present
Surplus is to determine whether need to choose a background program (program of the priority greater than 0 from the program 40 of more low priority
40) it discharges.If background program all discharges, and system be in preset second time interval it is low
When the state of memory, some foreground program (priority is equal to 0 program 40) will be selected to discharge, to guarantee electronic device 100
It is not stuck.
As shown in fig.2, being the operation process chart of memory release method preferred embodiment of the present invention.
Priority belonging to program 40 in the residual capacity and electronic device 100 of memory 30 is arranged in step S10, setup module 11
Association between range.For example, the association includes: the residual capacity when memory 30 less than the first preset threshold (such as 40M)
And when being greater than or equal to the second preset threshold (such as 16M), priority limit belonging to program 40 is greater than or waits in electronic device 100
In the first pre-set priority (such as 15);When memory 30 residual capacity less than the second preset threshold (such as 16M) and be greater than or
When equal to third preset threshold (such as 8M), it is pre- to be greater than or equal to second for priority limit belonging to program 40 in electronic device 100
Setting priority (such as 7);When the residual capacity of memory 30 is less than third preset threshold (such as 8M) and is greater than or equal to the 4th in advance
If when threshold values (such as 3M), priority limit belonging to program 40 is greater than or equal to third pre-set priority (example in electronic device 100
As 1);When memory 30 residual capacity less than the 4th preset threshold (such as 3M) and be greater than or equal to the 5th preset threshold (such as
When 0M), priority limit belonging to program 40 is greater than the 4th pre-set priority (such as 0) in electronic device 100.
Step S20 obtains the current remaining capacity that module 12 obtains memory 30 every a preset first time interval.
The first time interval is by user or systemic presupposition, for example 50 milliseconds (ms).
Step S30, when electronic device 100 needs releasing memory 30, determining module 13 is according to the current residual of memory 30
Capacity and the association determine priority limit belonging to the theory for the program 40 that electronic device 100 to be discharged.For example, if memory
30 current remaining capacity is 30M, is less than first preset threshold and is greater than second preset threshold, it is determined that module 13
Determine that priority limit belonging to 40 theory of program that electronic device 100 to be discharged is greater than or equal to 15.It should be noted that when interior
Deposit 30 residual capacity be less than first preset threshold, and electronic device 100 currently without program 40 release when, then illustrate
Electronic device 100 needs releasing memory 30.
Step S40, determination module 14 according in the affiliated priority limit of above-mentioned theory with the presence or absence of the program that is currently running
40, determine priority limit belonging to 40 reality of program currently to be discharged of electronic device 100.The judgement electronic device 100 is worked as
Before the process of priority limit belonging to 40 reality of program to be discharged will describe in detail in Fig. 3.
Step S50 is found in the program 40 being currently running corresponding to the priority limit belonging to the reality of module 15
Find out the maximum program 40 of committed memory capacity.
Step S60, release module 16 records the maximum program 40 of the committed memory capacity into storage unit 20, and releases
Put the maximum program 40 of the committed memory capacity.
As shown in fig.3, memory release method preferred embodiment of the present invention determines that electronic device 100 will currently discharge
The sub-process figure of priority limit belonging to 40 reality of program.
Step S400, determination module 14 judge in priority limit belonging to the theory with the presence or absence of the program being currently running
40.When there is the program 40 being currently running in priority limit belonging to the theory, step S460 is executed, determination module 14 is sentenced
Priority limit belonging to fixed 40 reality of program currently to be discharged is priority limit belonging to the theory.When the theory
There is no when the program 40 being currently running in affiliated priority limit, step S410 is executed.
Step S410, determination module 14 judge in electronic device 100 with the presence or absence of bulk memory.When in electronic device 100
There is no when bulk memory, execute step S420 otherwise directly to terminate process.
Step S420, determination module 14 judge the journey in electronic device 100 with the presence or absence of the priority being currently running greater than 0
Sequence 40.When, there is no when the program 40 that the priority being currently running is greater than 0, executing step S430 in electronic device 100, otherwise,
Execute step S450.
Step S430, determination module 14 judge electronic device 100 whether in preset second time interval not
It is greater than 0 program 40 in the presence of the priority being currently running.When electronic device 100 in preset second time interval not
When being greater than 0 program 40 in the presence of the priority being currently running, step S440 is executed, otherwise, executes step S450.Second time
Interval is by user or systemic presupposition, for example 500ms.
Step S440, determination module 14 determine that priority limit belonging to 40 reality of program currently to be discharged is equal to 0.
Step S450, determination module 14 determine that priority limit belonging to 40 reality of program currently to be discharged is greater than 0.
It should be noted last that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although ginseng
It is described the invention in detail according to the above preferred embodiment, those skilled in the art should understand that, it can be to this
The technical solution of invention is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.
Claims (4)
1. a kind of memory release method is applied in electronic device, which is characterized in that this method comprises:
Setting steps: being associated between the residual capacity of memory and the affiliated priority limit of program in electronic device is set;
The association includes:
When the residual capacity of memory is less than the first preset threshold and is greater than or equal to the second preset threshold, program in electronic device
Affiliated priority limit is greater than or equal to the first pre-set priority;
When the residual capacity of memory is less than the second preset threshold and is greater than or equal to third preset threshold, program in electronic device
Affiliated priority limit is greater than or equal to the second pre-set priority;
When the residual capacity of memory is less than third preset threshold and is greater than or equal to four preset thresholds, program in electronic device
Affiliated priority limit is greater than or equal to third pre-set priority;And
When the residual capacity of memory is less than the 4th preset threshold and is greater than or equal to five preset thresholds, program in electronic device
Affiliated priority limit is greater than the 4th pre-set priority;
Obtaining step: the current remaining capacity of memory is obtained every a preset first time interval;
It determines step: when electronic device needs releasing memory, according to the current remaining capacity of memory and the association, determining electricity
Priority limit belonging to the theory of the sub-device program to be discharged;
Determination step: according to whether there is the program being currently running in the affiliated priority limit of above-mentioned theory, determine electronic device
Priority limit belonging to the program reality currently to be discharged;
The determination step includes:
When there is the program being currently running in priority limit belonging to the theory, determine that the program currently to be discharged is real
The affiliated priority limit in border is priority limit belonging to the theory;
There is no the programs being currently running in priority limit belonging to the theory, and bulk memory is not present in electronic device,
However when there is the program for being greater than the 4th pre-set priority being currently running in electronic device, judgement described will currently discharge
Program reality belonging to priority limit be greater than the 4th pre-set priority;And
There is no the programs being currently running in priority limit belonging to the theory, and bulk memory is not present in electronic device,
And electronic device is default greater than the described 4th preferential there is no what is be currently running in preset second time interval
When the program of grade, determine that priority limit belonging to the program reality currently to be discharged is equal to the 4th pre-set priority;
It finds step: finding out committed memory capacity in the program being currently running corresponding to the priority limit belonging to the reality
Maximum program;And
Release steps: the maximum program of committed memory capacity is discharged.
2. memory release method as described in claim 1, which is characterized in that when the residual capacity of memory is less than described first in advance
If threshold values, and electronic device currently without program release when, then electronic device needs releasing memory.
3. a kind of memory discharges system, run in electronic device, which is characterized in that the system includes:
Setup module, for being associated between the residual capacity of memory and the affiliated priority limit of program in electronic device to be arranged;
The association includes:
When the residual capacity of memory is less than the first preset threshold and is greater than or equal to the second preset threshold, program in electronic device
Affiliated priority limit is greater than or equal to the first pre-set priority;
When the residual capacity of memory is less than the second preset threshold and is greater than or equal to third preset threshold, program in electronic device
Affiliated priority limit is greater than or equal to the second pre-set priority;
When the residual capacity of memory is less than third preset threshold and is greater than or equal to four preset thresholds, program in electronic device
Affiliated priority limit is greater than or equal to third pre-set priority;And
When the residual capacity of memory is less than the 4th preset threshold and is greater than or equal to five preset thresholds, program in electronic device
Affiliated priority limit is greater than the 4th pre-set priority;
Module is obtained, for obtaining the current remaining capacity of memory every a preset first time interval;
Determining module, for when electronic device needs releasing memory, according to the current remaining capacity of memory and the association, really
Determine priority limit belonging to the theory for the program that electronic device to be discharged;
Determination module, for determining electronics according to whether there is the program being currently running in the affiliated priority limit of above-mentioned theory
Priority limit belonging to the device program reality currently to be discharged;
The determination module determines priority limit belonging to the electronic device program reality currently to be discharged by following steps:
When there is the program being currently running in priority limit belonging to the theory, determine that the program currently to be discharged is real
The affiliated priority limit in border is priority limit belonging to the theory;
There is no the programs being currently running in priority limit belonging to the theory, and bulk memory is not present in electronic device,
However when there is the program for being greater than the 4th pre-set priority being currently running in electronic device, judgement described will currently discharge
Program reality belonging to priority limit be greater than the 4th pre-set priority;And
There is no the programs being currently running in priority limit belonging to the theory, and bulk memory is not present in electronic device,
And electronic device is default greater than the described 4th preferential there is no what is be currently running in preset second time interval
When the program of grade, determine that priority limit belonging to the program reality currently to be discharged is equal to the 4th pre-set priority;
Module is found, finds out committed memory in the program for being currently running corresponding to the priority limit belonging to the reality
The maximum program of capacity;And
Release module, for discharging the maximum program of committed memory capacity.
4. memory as claimed in claim 3 discharges system, which is characterized in that when the residual capacity of memory is less than described first in advance
If threshold values, and electronic device currently without program release when, then electronic device needs releasing memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310139927.9A CN104111873B (en) | 2013-04-22 | 2013-04-22 | Memory release method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310139927.9A CN104111873B (en) | 2013-04-22 | 2013-04-22 | Memory release method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104111873A CN104111873A (en) | 2014-10-22 |
CN104111873B true CN104111873B (en) | 2019-02-26 |
Family
ID=51708671
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310139927.9A Active CN104111873B (en) | 2013-04-22 | 2013-04-22 | Memory release method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104111873B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105701025B (en) * | 2015-12-31 | 2019-07-23 | 华为技术有限公司 | A kind of method for recovering internal storage and device |
CN107168792A (en) * | 2017-04-24 | 2017-09-15 | 宇龙计算机通信科技(深圳)有限公司 | A kind of process management method and terminal device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521057A (en) * | 2011-12-31 | 2012-06-27 | 曙光信息产业股份有限公司 | Resource scheduling method and device |
CN102799471A (en) * | 2012-05-25 | 2012-11-28 | 上海斐讯数据通信技术有限公司 | Method and system for process recycling of operating system |
CN102968335A (en) * | 2012-10-25 | 2013-03-13 | 东莞宇龙通信科技有限公司 | Terminal and terminal memory management method |
CN103024538A (en) * | 2012-11-12 | 2013-04-03 | 北京奇虎科技有限公司 | Memory management method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8510743B2 (en) * | 2007-10-31 | 2013-08-13 | Google Inc. | Terminating computer applications |
-
2013
- 2013-04-22 CN CN201310139927.9A patent/CN104111873B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521057A (en) * | 2011-12-31 | 2012-06-27 | 曙光信息产业股份有限公司 | Resource scheduling method and device |
CN102799471A (en) * | 2012-05-25 | 2012-11-28 | 上海斐讯数据通信技术有限公司 | Method and system for process recycling of operating system |
CN102968335A (en) * | 2012-10-25 | 2013-03-13 | 东莞宇龙通信科技有限公司 | Terminal and terminal memory management method |
CN103024538A (en) * | 2012-11-12 | 2013-04-03 | 北京奇虎科技有限公司 | Memory management method and system |
Also Published As
Publication number | Publication date |
---|---|
CN104111873A (en) | 2014-10-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11182213B2 (en) | Application program management method and device | |
CN105676993A (en) | Method and device for saving electric quantity and electronic equipment | |
CN106528216A (en) | Method for starting application and terminal | |
CN105159777A (en) | Process memory collection method and apparatus | |
CN104216753A (en) | Method for rapidly starting application program for terminal, and terminal | |
CN108701026A (en) | Method and apparatus for the managing process under memory constraints | |
CN104503828A (en) | Process management method and terminal | |
KR20130021625A (en) | Operating method and portable device supporting the same | |
CN104932933A (en) | Spin lock acquisition method and apparatus | |
CN104808767A (en) | Terminal control method | |
CN105373485A (en) | Memory cleaning system and method and terminal device | |
CN104808766A (en) | Terminal | |
CN103543901B (en) | The method and apparatus generating menu | |
CN104111873B (en) | Memory release method and system | |
CN105279426A (en) | Electronic device capable of configuring application-dependent task based on operating behavior of application detected during execution of application and related method thereof | |
WO2016145804A1 (en) | Data processing and device | |
CN104503881B (en) | The method of handheld device consumption detection, device and handheld device | |
CN115587049A (en) | Memory recovery method and device, electronic equipment and storage medium | |
CN105354066A (en) | OTA (over the air) downloading method, device and intelligent terminal | |
CN109271538A (en) | A kind of picture storage method and relevant device | |
CN105320246A (en) | Information processing method and electronic device | |
CN104156052A (en) | Method for managing real-time desktop clock | |
CN106034182A (en) | Method, device and terminal for controlling electric quantity loss | |
CN105302597A (en) | Information processing method and electronic equipment | |
CN111078405B (en) | Memory allocation method and device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |