CN108228341A - Method for recovering internal storage and device, terminal device and computer readable storage medium - Google Patents

Method for recovering internal storage and device, terminal device and computer readable storage medium Download PDF

Info

Publication number
CN108228341A
CN108228341A CN201710668172.XA CN201710668172A CN108228341A CN 108228341 A CN108228341 A CN 108228341A CN 201710668172 A CN201710668172 A CN 201710668172A CN 108228341 A CN108228341 A CN 108228341A
Authority
CN
China
Prior art keywords
physical page
memory
value
destination application
liveness
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.)
Granted
Application number
CN201710668172.XA
Other languages
Chinese (zh)
Other versions
CN108228341B (en
Inventor
陈乾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Meizu Technology Co Ltd
Original Assignee
Meizu Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Meizu Technology Co Ltd filed Critical Meizu Technology Co Ltd
Priority to CN201710668172.XA priority Critical patent/CN108228341B/en
Publication of CN108228341A publication Critical patent/CN108228341A/en
Application granted granted Critical
Publication of CN108228341B publication Critical patent/CN108228341B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Abstract

The present invention provides a kind of method for recovering internal storage and device, terminal device and computer readable storage medium, and this method includes obtaining the destination application being currently running, and judges whether destination application is Memory recycle protection application program;If so, the Memory recycle operation for being not more than the first preset times is performed to destination application in predetermined time period;Otherwise, destination application is performed in predetermined time period and is no less than the Memory recycle operation of the second preset times or closes destination application, the first preset times are less than or equal to the second preset times.The device is used to implement above-mentioned method for recovering internal storage.Terminal device provided by the invention has processor and memory, and processor can realize above-mentioned method for recovering internal storage when performing computer program.It is stored on the computer readable storage medium of the present invention and is used to implement above method computer program.The present invention can be directed to different types of application program and use different method for recovering internal storage.

Description

Method for recovering internal storage and device, terminal device and computer readable storage medium
Technical field
The present invention relates to the control field of electronic equipment, specifically realizing Memory recycle on the terminal device in one kind Method and the device for realizing this method, further relate to a kind of terminal device for realizing the above method and computer-readable storage Medium.
Background technology
The terminal devices such as smart mobile phone, tablet computer become the most frequently used electronic equipment in people's daily life, people Like various application programs are installed on intelligent electronic device, and on the terminal device simultaneously run largely apply journey Sequence.And in the operating system of terminal device, in order to accelerate to be written and read disk the speed of operation, it will usually by a large amount of data Caching is in memory.Process needs committed memory of filing an application and start before memory is used, after memory has been used again in time Recycle memory.Since user is during using terminal is applied, application is often frequently replaced, in order to reduce the waiting of user Duration, operating system would generally be transferred to backstage application process retain its occupancy memory.But when background application is excessive, It, can be because Memory Allocation deficiency causes operating system exception occur when memory is largely occupied and cannot recycled.
In order to avoid the system exception caused by Memory Allocation deficiency, operating system introduces the reclaim mechanism to memory. For example, when low memory, system can close some background process to recycle the memory of its occupancy.But when user needs to make During application program corresponding with these processes, these processes needs are completely reloaded, and time-consuming, reduce user's body It tests.Therefore, the prior art proposes the method that Memory recycle is carried out in the case of not closing process.Chained list is at least used in the recent period LRU arranges Physical Page according to recent service condition, and when low memory, system can be preferentially to therein Physical Page in the two chained lists of INACTIVE_ANON and INACTIVE_FILE is recycled.ANON represents anonymous mapping, does not have There is backing storage, FILE represents File Mapping, and INACTIVE is represented in inactive state.When process is needed using recycling During content on Physical Page, as long as loading corresponding contents from disk, reduce and take.But the application of front stage operation into Journey or the high application process of the priority of running background, the Physical Page occupied may also be in INACTIVE_ANON and In the two chained lists of INACTIVE_FILE, the Physical Page in the two chained lists, which is recycled, may influence this two classes application Normal operation, reduce user experience.
In order to ensure the normal operation of the high application process of the priority of foreground application process and running background, the prior art The method for proposing to carry out Memory recycle for process obtains the Physical Page of target process, is searched later not by target process first The target physical page that uses simultaneously recycles target physical page.But in the existing method that Memory recycle is carried out to process, time For the target physical page of receipts only for the target physical page not used by target process, target physical page is mainly that target process exists Physical Page in the two chained lists of INACTIVE_ANON and INACTIVE_FILE, that is, the Physical Page of inactive state, this The Memory recycle efficiency of kind method is very low.
If in addition, carrying out Memory recycle operation to the process of application program that user is commonly used, can cause to apply journey Often process is reloaded in loading to sequence, is caused application program operation slow, is influenced user experience.
Invention content
The first object of the present invention is to provide a kind of different type application program of distinguishing using different Memory recycle modes Method for recovering internal storage.
The second object of the present invention, which is to provide, a kind of to be avoided performing the application program that frequently uses Memory recycle operation Memory recycle device.
The third object of the present invention is to provide a kind of terminal device that can realize above-mentioned method for recovering internal storage.
The fourth object of the present invention, which is to provide when one kind is read out by the processor and performs, can realize above-mentioned Memory recycle side The computer readable storage medium of method.
In order to realize the first above-mentioned purpose, method for recovering internal storage provided by the invention is applied to terminal device, this method Including obtaining the destination application being currently running, judge whether destination application is Memory recycle protection application program;Such as It is Memory recycle protection application program to determine destination application, destination application is performed in predetermined time period few It is operated in the Memory recycle of the first preset times;It is not Memory recycle protection application program such as to determine destination application, pre- If the Memory recycle operation for being no less than the second preset times is performed in time span to destination application or closing target should Use program;Wherein, the first preset times are less than or equal to the second preset times.
By said program as it can be seen that for different application programs using different ways of recycling, such as Memory recycle Application program is protected, then by the way of less recovered frequency, for not being that Memory recycle protects application program, such as frequency of use Relatively low application program, then may be used the operation of multiple Memory recycle by discharge it is more in a manner of to discharge more memories.
One Preferable scheme is that, determine destination application be Memory recycle protection application program include:Obtain target The running frequency of application program determines that the running frequency of destination application is higher than preset operating frequency;Alternatively, determine that target should It is the application program in default Memory recycle protection list with program;Alternatively, determine destination application answering for preset kind Use program.
It can be seen that for the application program in the higher application program of running frequency, default Memory recycle protection list And the application program of preset kind, Memory recycle is carried out in a manner that recovered frequency is less, avoids these application program quilts Frequently execute the speed of service that Memory recycle operates and influences application program.
Further embodiment is to determine that destination application is not after Memory recycle protects application program, and obtaining target should The memory value occupied with program, judges whether the memory value that destination application occupies is more than default memory value, if so, then pre- If performing the Memory recycle operation for being no less than the second preset times in time span to destination application, otherwise, target is closed Application program.
As it can be seen that for the less application program of committed memory value, the operation that Memory recycle is performed to application program is not used, But directly by closing application program, so as to recycle more memories.
Preferably, the second preset times are more than secondary;Destination application is performed in predetermined time period many Include in the Memory recycle operation of the second preset times:After performing a Memory recycle operation, after the first interval time, hold Memory recycle operates row next time.
Preferably, the Memory recycle for being not more than the first preset times is performed to destination application in predetermined time period Operation includes:The Memory recycle more than secondary is performed to destination application in predetermined time period to operate, also, perform one After secondary Memory recycle operation, after the second interval time, perform Memory recycle next time and operate;Second interval time was more than the One interval time.
It can be seen that for the application program of Memory recycle protection, multiple Memory recycle is performed in predetermined time period The time interval of operation is more than the time interval that non-Memory recycle protection application program performs Memory recycle operation twice, so as to subtract Small Memory recycle preserves the number of the Memory recycle operation of application program.
Further embodiment is to perform Memory recycle operation to destination application to include:Obtain destination application just In the target process of operation, and obtain the corresponding target physical page of target process;Read the value of the liveness of target physical page, mesh Mark active level of the liveness of Physical Page for marking target reason page, the value and target physical of the liveness of target physical page The active level positive correlation of page;If the value of the liveness of target physical page is higher than recycling standard, and the value of liveness is higher than recycling The Physical Page of standard is in active state, then reduces the liveness of target physical page;Read again the liveness of target physical page Value;If the value of the liveness of target physical page is not higher than recycling standard, target physical page is recycled.
By said program as it can be seen that after the corresponding target physical page of target process is obtained, if target physical page enlivens The value of degree is higher than recycling standard, can reduce the liveness of target physical page, and be not higher than back in the liveness of target physical page During receipts standard, target physical page is recycled.In this way, even if target physical page is the Physical Page of active state, the present invention Have an opportunity to recycle target physical page, compared with the prior art, the present invention greatly expands the object of Memory recycle, improves Memory recycle efficiency.
Further, reduce target physical page liveness after, read target physical page liveness value it Before, open timer;When the duration of timer record reaches preset duration, the value of the liveness of target physical page is read in triggering The step of.
Further, before opening timer, preset duration, preset duration and EMS memory occupation are set according to memory usage Rate is negatively correlated;Alternatively, the priority positive of preset duration, preset duration and target process is set according to the priority of target process It closes.
Further, the selectable value of liveness includes at least the first value, second value and third value, and the first value is not higher than recycling Standard, second value are less than third value, and higher than recycling standard.
Further, the liveness for reducing target physical page includes:It, will when the liveness of target physical page is third value The liveness of target physical page is set as second value;When the liveness of target physical page is second value, by target physical page Liveness is set as the first value.
Further, the liveness for reducing target physical page includes:When target physical page is anonymous page, according to the first width Degree reduces the liveness of target physical page;When target physical page is file page, according to the second amplitude reduction target physical page Liveness;First amplitude is less than the second amplitude.
To realize the second above-mentioned purpose, Memory recycle device provided by the invention is applied to terminal device, the device packet Acquisition module is included, for obtaining the destination application being currently running;Judgment module, for judge destination application whether be Memory recycle protects application program;Memory recycle module, for determining that destination application is that journey is applied in Memory recycle protection During sequence, the Memory recycle operation for being not more than the first preset times is performed to destination application in predetermined time period;And Determine destination application be not Memory recycle protection application program when, in predetermined time period to destination application perform Destination application is closed in the Memory recycle operation of no less than the second preset times;Wherein, the first preset times are less than the Two preset times.
Preferable scheme is that judgment module is specifically used for:The running frequency of destination application is obtained, judges intended application Whether the running frequency of program is higher than preset operating frequency;Alternatively, judging whether destination application is that default Memory recycle is protected Protect the application program in list;Alternatively, judge destination application whether be preset kind application program.
Further, Memory recycle module includes:Acquisition module, for obtaining the corresponding target physical page of target process; First read module, for reading the value of the liveness of target physical page, the liveness of target physical page is used for marking target Manage the active level of page, the value of the liveness of target physical page and the active level positive correlation of target physical page;Module is reduced, is used When the value of the liveness when target physical page is higher than recycling standard, the liveness of target physical page is reduced, the value of liveness is high It is in active state in the Physical Page of recycling standard;Second read module, in the work for reducing module reduction target physical page The value of jerk and then the secondary liveness for reading target physical page;Recycling module, for working as the value of the liveness of target physical page During not higher than recycling standard, target physical page is recycled.
Further, Memory recycle module further includes the first setup module, for timing module open timer before, Preset duration is set according to memory usage, preset duration is negatively correlated with memory usage;Alternatively, the second setup module, is used for Before timing module opens timer, preset duration, preset duration and target process are set according to the priority of target process Priority positive correlation.
Further, the selectable value of liveness includes at least the first value, second value and third value, and the first value is not higher than recycling Standard, second value are less than third value, and higher than recycling standard.
Further, module is reduced to include:Setting unit, for when the liveness of target physical page is third value, inciting somebody to action The liveness of target physical page is set as second value;When the liveness of target physical page is second value, by target physical page Liveness is set as the first value.
Further, module is reduced to include:Unit is reduced, for when target physical page is anonymous page, according to the first width Degree reduces the liveness of target physical page;When target physical page is file page, according to the second amplitude reduction target physical page Liveness;First amplitude is less than the second amplitude.
To realize above-mentioned third purpose, terminal device provided by the invention includes processor, and processor is deposited for performing Each step of above-mentioned method for recovering internal storage is realized during the computer program stored in reservoir.
To realize the 4th above-mentioned purpose, computer journey is stored on computer readable storage medium provided by the invention Sequence, the computer program realize each step of above-mentioned method for recovering internal storage when being executed by processor.
Description of the drawings
Fig. 1 is the flow chart of method for recovering internal storage embodiment of the present invention.
Fig. 2 is to perform Memory recycle behaviour to non-Memory recycle protection application program in method for recovering internal storage embodiment of the present invention The flow chart of work.
Fig. 3 is to perform Memory recycle to Memory recycle protection destination application in method for recovering internal storage embodiment of the present invention The flow chart of operation.
Fig. 4 is of the target process Memory recycle to destination application in method for recovering internal storage embodiment of the present invention A kind of flow chart of mode.
Fig. 5 is of the target process Memory recycle to destination application in method for recovering internal storage embodiment of the present invention The flow chart of two kinds of modes.
Fig. 6 is of the target process Memory recycle to destination application in method for recovering internal storage embodiment of the present invention The flow chart of three kinds of modes.
Fig. 7 is of the target process Memory recycle to destination application in method for recovering internal storage embodiment of the present invention The flow chart of four kinds of modes.
Fig. 8 is the structure diagram of terminal equipment control embodiment of the present invention.
Fig. 9 is a kind of structure diagram of mode of Memory recycle module of terminal equipment control embodiment of the present invention.
Figure 10 is the structure diagram of the Memory recycle module another way of terminal equipment control embodiment of the present invention.
Figure 11 is the structure diagram of terminal device embodiment of the present invention.
The invention will be further described with reference to the accompanying drawings and embodiments.
Specific embodiment
Method for recovering internal storage of the present invention is applied on the terminal devices such as smart mobile phone or tablet computer, for reality The recycling of the occupied memory of existing application program.The Memory recycle device operation of this hair invention on the terminal device, and is used for Realize above-mentioned method for recovering internal storage.
Since user is during application program is used, often application program used in frequent replacement, such as profit During video being watched with video jukebox software, it may be necessary to chat application frequently are switched to foreground, in order to reduce use The waiting time at family, operating system would generally be transferred to backstage application process retain its occupancy memory.But when backstage is transported Capable application program is excessive, can be because Memory Allocation deficiency is led when the memory of terminal device is largely occupied and cannot discharged Operating system is caused to occur abnormal.
Terminal device can carry out Memory recycle by closing application program, can also by not closing application program, But the mode that Memory recycle is carried out to the process of application program carries out Memory recycle.However, some application program is to use The application program that family is commonly used if frequently performing Memory recycle operation to this certain applications program, leads to user's weight Newly in the front stage operation application program, which needs to reload process, and the operation for leading to application program is slow, shadow Ring user experience.Therefore, it is necessary to the Memory recycle mode of differentiation is used to different types of application program.
It is provided by the invention for different types of application program using differentiation method for recovering internal storage as shown in Figure 1, Include the following steps:
Step S101 obtains the application program being currently running.
When the current free memory amount of terminal device is relatively low or terminal device operation is slow, operating system can be actively Send out Memory recycle operation instruction, that is, for one or more application program perform Memory recycle, at this time, it may be necessary to Obtain the destination application being currently running.For example, the application list information being currently running by task manager acquisition, The application program being currently running is obtained from the list information.It should be noted that the application program acquired in step S101 can To be the application program of front stage operation or be placed in the application program of running background.
Step S102 judges whether destination application is Memory recycle protection application program, if so, being transferred to step Otherwise S103, is transferred to step S104.
After destination application is obtained, the type of destination application is judged, that is, judge intended application Whether program is Memory recycle protection application program.In the present embodiment, Memory recycle protection application program be need to perform it is less The number of Memory recycle operation or the application program for not performing Memory recycle operation, specifically, Memory recycle protection is using journey Sequence can be the application program of the more favorite application program of user, the application program in default white list or preset kind.
A kind of situation of Memory recycle protection application program is the higher application program of user's favorable rating, for example, can be with Favorable rating of the user to a certain application program is determined by Meizu OneMind application programs, if user's favorable rating is higher than Preset threshold value, then it represents that user likes the application program very much, then the application program is Memory recycle protection application program.
A kind of mode for determining user's favorable rating is to calculate the running frequency of destination application, in the present embodiment, mesh Mark application program running frequency be in the unit interval destination application run number, destination application in the unit interval Number of run is more, then running frequency is higher, opposite, destination application number of run is fewer in the unit interval, then runs Frequency is lower.Specifically, number of run can be the number that destination application is placed in front stage operation, that is, intended application journey Sequence calculates the number of a destination application front stage operation from when being transferred to front stage operation from the background.
Certainly, running frequency can also be that destination application performs time for receiving user operation instruction in the unit interval Number for example, when destination application is run, receives the number of user's clicking operation page, the number for receiving acoustic control instruction etc., single The user operation instruction number received in the time of position is more, and the running frequency of destination application is higher, opposite, the unit interval The user operation instruction number of interior reception is fewer, and the running frequency of destination application is lower.
The third mode for determining the running frequency of destination application is in the unit of account time before destination application The time span of platform operation, the time span of destination application front stage operation is longer in the unit interval, then destination application Running frequency it is higher, opposite, unit interval destination application front stage operation time span is shorter, destination application Running frequency is lower.
When the running frequency of destination application is higher than preset running frequency, it is memory to determine the destination application Recycling protection application program, if the running frequency of destination application is less than the preset running frequency, it is determined that the mesh Mark application program is not Memory recycle protection application program.
In addition, Memory recycle protection application program can also be the application program in default Memory recycle protection list, example Such as, white list is pre-set, which is exactly the list of Memory recycle protection application program, if destination application is interior It is stored back to the application program received in protection the application list, it is determined that destination application is Memory recycle protection application program.
In addition, Memory recycle protection application program can also be the application program of preset kind, for example, the application of game class Program.When depositing reclaimer operation inside due to the application program of game class can not effective releasing memory, can be as far as possible Few application program to game class performs Memory recycle operation, that is, the application program of game class is determined as preset kind Application program.Certainly, the application program of preset kind can also include the application program of instant messaging class, web page browsing class is answered With program etc..
In step s 102, if it is determined that the running frequency of destination application is higher than preset running frequency or really The application program that sets the goal is application program in default Memory recycle protection list or determining destination application is default class The application program of type, then it is Memory recycle protection application program that can determine destination application.
Step S103 performs destination application in predetermined time period and is stored back in not more than the first preset times It brings drill to an end work.
If it is determined that destination application is Memory recycle protection application program, then it represents that destination application should not be by The Memory recycle operation of more number is performed, therefore, it is necessary to limit the number that destination application is performed Memory recycle and operated. For example, predetermined time period is three minutes, the first preset times are application programs that is primary, then being protected for Memory recycle, Primary Memory recycle operation can only be at most performed in three minutes, does not perform Memory recycle operation even.It is appreciated that in the limit In the case of, the first preset times are zero degrees, that is, do not perform Memory recycle operation to Memory recycle protection application program.
In other words, if it is determined that destination application is Memory recycle protection application program, then reduces destination application The priority of Memory recycle operation is performed, it is as few to memory as possible when being operated in order to perform Memory recycle to application program Recycling protection application program performs Memory recycle operation, and is stored back in more being performed to the application program of non-Memory recycle protection It brings drill to an end work.
Certainly, predetermined time period can adjust according to actual needs with the first preset times, for example, system default is set Predetermined time period is five minutes, and the first preset times are that twice, user can change predetermined time period according to actual needs And first preset times, such as predetermined time period is revised as eight minutes, the first preset times are revised as three times.In addition, System can also determine the first preset times according to different application program actual conditions, it will be understood that each application program First preset times there are one corresponding, and corresponding first preset times of different application programs can differ.
Step S104, judges whether the memory value that destination application occupies is more than default memory value, if so, being transferred to step Otherwise S105, is transferred to step S105.
In step s 102, if it is determined that destination application is not Memory recycle protection application program, then it represents that can be with The Memory recycle operation of more number is performed to destination application or directly closes destination application.Certainly, it needs Determine close destination application standard, therefore, in the present embodiment, by memory value occupied to destination application come Determine whether to perform destination application Memory recycle operation or close application program.
Therefore, the memory value occupied in step S104 to destination application calculates.Specifically, obtain intended application The process that program is currently running for example, obtaining the process list of destination application, obtains the application program from process list All processes being currently running.Then, pass through the Activity Manager's of operating system GetProcessMemoryInfo can obtain the occupied memory information of each process.During due to obtaining process list The progress recognizing PID of each process is obtained, therefore, can each process be obtained according to the progress recognizing PID of process Shared memory information.The occupied memory of each process of destination application is added, you can to obtain destination application Occupied memory value.
One default memory value of operating system default setting, such as 100M.Certainly, user can also adjust this as needed Default memory value, such as it is adjusted to 150M or 200M.
Step S105 performs destination application in predetermined time period and is stored back in no less than the second preset times It brings drill to an end work.
In step S104, if it is determined that the memory value that destination application occupies is more than default memory value, represents target Application program occupies a large amount of memory source, then can be by way of memory discharge operation is performed a plurality of times by destination application Occupied memory source release.Specifically, multiple Memory recycle operation is performed in predetermined time period.Wherein, step The predetermined time period of S105 and the predetermined time period of step S 103 are identical time spans, be such as all three minutes or Five minutes.
Also, the Memory recycle number of operations performed in predetermined time period is no less than the second preset times, such as twice Or three times.In the present embodiment, the second preset times are a values for being more than or equal to the first preset times, for example, first Preset times are that twice, then the second preset times are twice or three times even more numbers.In this way it can be ensured that in phase In same time span, the Memory recycle number performed for non-Memory recycle protection application program receives protection more than internal be stored back to The Memory recycle number that application program performs.
Step S106 closes destination application.
If in step S104, determine that the memory value that destination application occupies is less than default memory value, then it represents that target Application program is not Memory recycle protection application program, and occupied memory value is smaller, therefore, should by closing target Memory recycle operation can be carried out to destination application with significantly more efficient with program.After destination application is closed, mesh The mark occupied memory of application program will be all released.
As it can be seen that for the application program in the higher application program of user's favorable rating, default white list and default class The application program of type, can be as few as possible execution Memory recycle operation, can reduce these application programs loading process when Between.For other applications, then multiple Memory recycle operation can be performed, so as to significantly more efficient to occupied by application program Memory recycled.
Certainly, when Memory recycle operation is performed to destination application, if continuously performing Memory recycle operation, having Probably due to the time of the adjacent operation of Memory recycle twice is too short and leads to what is recycled during second of execution Memory recycle operation Memory is considerably less, it is necessary to set the execution time of adjacent Memory recycle twice operation, Fig. 2 shows a kind of methods.
Step S201, it is not that Memory recycle protects application program and committed memory value is more than default to determine destination application Memory value.
Since Fig. 2 is that the Memory recycle carried out for non-Memory recycle protection application program operates, firstly the need of true The application program that sets the goal is not Memory recycle protection application program.And it is further desired that determine destination application committed memory value More than default memory value, because the smaller application program of committed memory value will be directly closed rather than perform Memory recycle behaviour Make.
Step S202 performs a Memory recycle operation.
After determining to need to perform destination application multiple Memory recycle operation, destination application can be performed Memory recycle operation.There are many kinds of the modes for performing Memory recycle operation, and common mode is to obtain destination application The target process being currently running such as obtains the process list of destination application, the mesh being carrying out is obtained from process list Mark process.Then the corresponding Physical Page of target process is obtained, and identifies the inactive Physical Page in Physical Page, it will be inactive Physical Page is recycled.
But if only being recycled to inactive Physical Page, then the efficiency of Memory recycle is very low, often leading to can not Fully recycling memory, therefore, the present invention also propose a kind of method that Memory recycle is carried out to active physical page, specific recycling side Method will be discussed in detail below.
Step S203 opens timer.
After a Memory recycle operation is performed, timing will be started, timing time was the first interval time, that is, twice Time between Memory recycle operation.It is adjacent interior to be twice stored back to for not being Memory recycle protection application program in the present embodiment Bring drill to an end interval time of work can set shorter, such as 60 seconds or 90 seconds.Certainly, user can voluntarily set the first interval The length of time.
Step S204 judges whether to reach for the first interval time, if so, performing step S205, otherwise, continues to execute step S204。
After opening timer, need to judge whether current timing time reached for the first interval time, such as judge timing Whether the time reaches 60 seconds or 90 seconds, if not reaching for the first interval time, will continue waiting for.
Step S205 judges whether to reach predetermined time period, if so, then terminating, otherwise, returns and performs step S202.
If current timing time reached for the first interval time, also need to judge whether to reach predetermined time period, If reaching predetermined time period, do not need to perform Memory recycle operation again, if reaching predetermined time period not yet, It then also needs to perform the operation of more Memory recycles, that is, returns and perform step S202, until reaching predetermined time period.
As it can be seen that by setting for the first interval time, it can be ensured that will not continuously perform within the very short time in repeatedly Reclaimer operation is deposited, is conducive to the more memories of application program and is recovered.
Certainly, application program is protected for Memory recycle, it is also desirable to limit twice in succession between the time of Memory recycle operation Every Fig. 3 shows the flow that the Memory recycle performed to Memory recycle protection application program operates.Certainly, the flow of Fig. 3 is performed On condition that the Memory recycle number that Memory recycle protection application program performs is more than twice.
Step S301, it is Memory recycle protection application program to determine destination application.
For example, in the step S102 of Fig. 1, to destination application whether be Memory recycle protection application program judgement As a result it is yes.
Step S302 performs a Memory recycle operation.
After determining to need to perform destination application multiple Memory recycle operation, destination application can be performed Memory recycle operation.There are many kinds of the modes for performing Memory recycle operation, and common mode is to obtain destination application The target process being currently running, and the inactive Physical Page to target process in corresponding Physical Page recycles.Certainly, this reality It applies example and Memory recycle also is carried out to active physical page, specific recovery method will be discussed in detail below.
Step S303 opens timer.
After a Memory recycle operation is performed, timing will be started, timing time was the second interval time, that is, twice Time between Memory recycle operation.In the present embodiment, application program, the adjacent behaviour of Memory recycle twice are protected for Memory recycle The interval time of work can set longer, such as 120 seconds or 180 seconds.Certainly, when user can voluntarily set the second interval Between length.
It should be noted that in the present embodiment, the length of the second interval time was more than for the first interval time, in order to The operating interval time of Memory recycle twice for allowing Memory recycle protection application program is longer, is performed in preset time so as to reduce The number of Memory recycle.
Step 3204, judge whether to reach for the second interval time, if so, performing step S305, otherwise, continue to execute step S304。
After opening timer, need to judge whether current timing time reached for the second interval time, such as judge timing Whether the time reaches 120 seconds or 180 seconds, if not reaching for the second interval time, will continue waiting for.
Step S305 judges whether to reach predetermined time period, if so, then terminating, otherwise, returns and performs step S302.
If current timing time reached for the second interval time, also need to judge whether to reach predetermined time period, If reaching predetermined time period, do not need to perform Memory recycle operation again, if reaching predetermined time period not yet, It then also needs to perform the operation of more Memory recycles, that is, returns and perform step S302, until reaching predetermined time period.
As it can be seen that in the present embodiment, the operation that Memory recycle is performed to application program is separately performed a plurality of times, and adjacent There are certain time intervals for Memory recycle operation twice, in this way can be to avoid multiple reclaimer operation is continuously performed, on the one hand The considerations of for performance, the operation of the present embodiment are conducive to improve the performance of terminal device, another reverse side, since application program exists The active of backstage can constantly generate the new page, if carrying out page aging in the very short time, continuously perform multiple memory The Memory recycle that reclaimer operation will be quickly completed application program, and newly generated physical page cannot recycle below, it can only Kswapd processes dependent on system realize Memory recycle, influence the quality of Memory recycle instead.
The present invention is to obtain destination application currently first to the Memory recycle operation that destination application carries out The target process of operation such as obtains the process list of destination application, so that it is determined that destination application is currently running Target process, the operation of Memory recycle is then performed to each target process respectively.Performing Memory recycle operation is mainly Physical Page is recycled, and judges that the value height of Physical Page storage data can have many angles, the prior art usually with The active degree of Physical Page(Or liveness)Height come evaluate Physical Page storage data value height, the liveness of Physical Page Higher, system has been generally acknowledged that the value of Physical Page storage data is higher.In order to compare the liveness of Physical Page, the prior art is drawn Enter in the recent period at least using chained list LRU, arranged according to recent service condition, at least use there are chained list ends. Physical Page in this 4 chained lists of INACTIVE_ANON, ACTIVE_ANON, INACTIVE_FILE and ACTIVE_FILE is can With recycling, ANON represents anonymous mapping, and FILE represents File Mapping, and INACTIVE is represented in inactive state, ACTIVE Representative is in active state, and the liveness of the Physical Page in ACTIVE chained lists is higher than the Physical Page in INACTIVE chained lists, also It is to say, the Physical Page being in active state, its liveness is higher than the Physical Page in inactive state.When low memory, System can preferentially recycle the Physical Page in the INACTIVE_ANON in LRU and INACTIVE_FILE the two chained lists, When process needs the content on the Physical Page using recycling, need to load corresponding contents from disk.
But the application process of front stage operation or the high application process of the priority of running background, the physics occupied Page may also be in INACTIVE_ANON and INACTIVE_FILE the two chained lists, to foreground process in the two chained lists and The corresponding Physical Page of the high process of backstage priority is recycled, and can greatly increase the number of system disk read-write, and And increase the waiting time of user, reduce user experience.
As it can be seen that application process also should be used as a weight of evaluation Physical Page value height.For this purpose, the prior art proposes needle The method that Memory recycle is carried out to process, the first selected target process as Memory recycle object, and obtain target process Physical Page is searched later not by target physical page that target process uses and recycles target physical page, do not used by target process Target physical page refer mainly to the Physical Page in inactive state.
In actual scene test, the backstage process of one minute is fallen back on for one, all Physical Page occupied to it into Row recycling, wherein, Physical Page of the process in INACTIVE_ANON and INACTIVE_FILE chained lists only takes up property The 5% of page ratio is managed, and most of Physical Page is Physical Page of the process in ACTIVE_ANON and ACTIVE_FILE chained lists. As it can be seen that the existing method organic efficiency that Memory recycle is carried out for process is very low.
In order to improve organic efficiency, need to select the Physical Page in ACTIVE_ANON and ACTIVE_FILE chained lists Property recycling, it is preferred that be to recycle wherein to be worth relatively low Physical Page, in other words, the relatively low Physical Page of liveness.Therefore, originally When embodiment carries out Memory recycle for the target of destination application, using step as shown in Figure 4:
Step S401 obtains the corresponding target physical page of target process.
The virtual memory that the mode of the corresponding Physical Page of acquisition process according to progress recognizing PID, can find process is empty Between VMA, traversal VMA can find the corresponding Physical Page of process, can also the corresponding Physical Page of lookup process by other means, It is not specifically limited herein.Target physical page can be the corresponding whole Physical Page of target process, or target process pair The part physical page answered.The recycling of target process can be carried out by serial mode, that is to say, that recycling only selection one every time A Physical Page performs the recovery process of the present invention or can also be carried out by parallel mode as target physical page, that is, Say that the multiple Physical Page of simultaneous selection as target physical page, are performed simultaneously multiple Physical Page the recovery process of the present invention.
Step S402 reads the value of the liveness of target physical page.
After obtaining the corresponding target physical page of target process, the value of the liveness of target physical page, target can be read The liveness of Physical Page is for the active level of marking target reason page, value and the target physical page of the liveness of target physical page Active level positive correlation, that is to say, that the active level of Physical Page is higher, then the value of its liveness is bigger.Also, Physical Page The selectable value of liveness should be no less than two.
It should be noted that the value of liveness can be numerical value, the value of liveness can be determined according to numerical values recited at this time Size, still, the value of liveness should not only be limited to numerical value, as long as can determine the height of different value according to preset standard of comparison It is low.
Step S403 if the value of the liveness of target physical page is higher than recycling standard, reduces enlivening for target physical page Degree, the value of liveness are in active state higher than the Physical Page of recycling standard.
After the value for reading the liveness of target physical page, it can be determined that whether the value of the liveness of target physical page is higher than Recycling standard, the value of liveness are in active state higher than the Physical Page of recycling standard, and recycling standard can be considered as moving type Boundary value between the liveness of the liveness of the Physical Page of state and the Physical Page of inactive state.If it is determined that the work of target physical page The value of jerk is higher than recycling standard, then can reduce the liveness of target physical page, if it is determined that the liveness of target physical page Value can then perform other operations, such as recycling target physical page not higher than recycling standard.
Step S404 reads again the value of the liveness of target physical page.
After step S403, the value of the liveness of target physical page can be read.If before step S404, in step Read target physical page is accessed in S403, then the value of the liveness of the target physical page can increase.If in step Before S404, read target physical page is not accessed in step S403, then the value of the liveness of target physical page will After maintaining step S403 operation, that is, the value that is lowered after liveness.
Step S405 if the value of the liveness of target physical page is not higher than recycling standard, recycles target physical page.
After the value for reading again the liveness of target physical page, it can be determined that whether the value of the liveness of target physical page Higher than recycling standard, if the value of the liveness of target physical page is not higher than recycling standard, target physical page is recycled.If object When managing the value of the liveness of page not higher than recycling standard, show that target physical page is in inactive state, the prior art has very much To the method that the Physical Page of inactive state is recycled, therefore the present embodiment is repeated no more to the Physical Page of inactive state Recovery method.
In the present embodiment, aging, such as the liveness reduction that will enliven the page of active carry out the page by active Realize the recycling to enlivening the page.Certainly, during active aging target physical page, system can also be made full use of Kswapd processes carry out aging to target physical page, such as when target physical page is reduced, can call kswapd processes, The operation reduced using kswapd processes to the liveness of target physical page can more be filled using system resource, be reached in this way More preferably result.
Certainly, in the first Memory recycle mode, if the time interval between step S403 and step S404 is extremely short, Under limiting case, it is possible to understand that after the liveness that target physical page is reduced into step S403, directly perform step S404 and read The value of the liveness of target physical page, if there are two the selectable value of liveness, in this way, the corresponding place of nearly all target process It is recovered in the Physical Page of active state, target process is automatically closed in the system of being equivalent to, and increases user's waiting time.Therefore, It needs to increase mechanism of going back on one's word in the first embodiment, such as between step S403 and step S404 between setting reasonable time Every as duration of going back on one's word, if target physical page is accessed in the time interval of setting, the value raising of liveness reduces The possibility being recovered, the Physical Page for being conducive to prevent liveness higher are recovered.Based on this thinking, the present invention should to target Flow chart with the target process method for recovering internal storage second way of program is as shown in Figure 5.
Step S501 obtains the corresponding target physical page of target process.
Step S502 sets the priority of preset duration, preset duration and target process according to the priority of target process Positive correlation.
Duration of going back on one's word may also be referred to as preset duration, can be the fixation duration of system default, it is preferred that determining to be directed to After target process is recycled, when can read target process priority, and be preset according to the setting of the priority of target process It is long, so that the priority positive correlation of preset duration and target process, that is to say, that the higher process of priority is set for it Preset duration it is longer.
Alternatively, preset duration can also be set according to memory usage, preset duration is negatively correlated with memory usage, also It is to say, memory usage is higher, then preset duration is shorter, and organic efficiency is higher, to recycle more memories as early as possible.
Step S503, reads the value of the liveness of target physical page, and the liveness of target physical page is used for marking target Manage the active level of page, the value of the liveness of target physical page and the active level positive correlation of target physical page.
Whether step S504 judges the value of liveness of target physical page higher than recycling standard, if so, performing step S505, if it is not, then performing step S507.
After the value of liveness of target physical page is read, it can be determined that whether the value of the liveness of target physical page is high In recycling standard, the value of liveness is in active state higher than the Physical Page of recycling standard, if so, step S505 is performed, if It is no, then perform step S507.
Step S505 reduces the liveness of target physical page.
If it is determined that the value of the liveness of target physical page is higher than recycling standard, then enlivening for target physical page can be reduced Degree.
Step S506 opens timer.
After the liveness for reducing target physical page, timer can be opened, records duration.When the duration of timer record When reaching preset duration, repeating step S503 to step S504 can only be repeated once, that is to say, that if repeating for the first time When performing step S504, still judge that the value of the liveness of target physical page is higher than recycling standard, then no longer perform step S505, But directly exit the recovery process to target physical page, that is to say, that the Physical Page of active state is only once recycled It attempts.In order to improve organic efficiency, more memories are recycled, it is preferred that the Physical Page of active state is carried out twice or twice Above recycling is attempted, that is to say, that step S503 to step S504 can be repeated twice or more than twice.
Number of repetition can be preset as some finite value, and actual scene test result shows what preceding recycling three times was attempted Organic efficiency higher, it is very low that organic efficiency is attempted in the 4th time and recycling later, therefore number of repetition could be provided as three times.Separately Outside, can also number of repetition be set according to memory usage, memory usage is higher, and recovered frequency is more.Alternatively, actually making In, number of repetition can also be configured according to other considerations, the present embodiment does not limit this.
It should be noted that the execution sequences of step S502 in embodiments of the present invention are not limited to the suitable of foregoing description Sequence, since preset duration is used for step S506, as long as being performed before step S506, specific sequential does not limit.
Step S507 recycles target physical page.
If the value of the liveness of step S508 judgement target physical pages recycles target physical page not higher than recycling standard.
Mechanism of going back on one's word set by the present invention, in addition in such as second of implementation, by setting reasonable time interval, As duration of going back on one's word, it is recovered with the Physical Page for preventing liveness higher as possible, it can also be to being higher than the liveness of recycling standard Two or more is set optionally to be worth, is recovered in this way, the higher Physical Page of liveness is more difficult in recycling is attempted. Therefore, the present invention carries out the target process of destination application flow such as Fig. 6 of the third embodiment of method for recovering internal storage It is shown.
Step S601 sets the selectable value of Physical Page liveness, including the first value, second value, third value and the 4th value.
The selectable value of Physical Page liveness is set, for example the first value, second value, third value and the 4th value can be included, In, the first value is not higher than recycling standard, and second value is less than third value, and higher than recycling standard, and third value is less than the 4th value.Or It can be said that each selectable value represents the series of the liveness of Physical Page, value is higher, and the series of liveness is higher.
As an example, the active level of Physical Page can be assessed by setting flag bit, it is assumed that two flag bits of setting, The selectable value of each flag bit is 0 and 1, and the value of liveness can be used(First mark bit value, the second mark bit value)Carry out generation Table, then the selectable value of liveness includes(0,0)、(0,1)、(1,0)With(1,1), and default standard of comparison(0,0)It is less than(1, 0)It is less than(0,1)It is less than(1,1), that is to say, that(0,0)、(1,0)、(0,1)、(1,1)It increases step by step.
In actual use, the range of selectable value can also be set, without specifically setting each value.
Step S602 obtains the corresponding target physical page of target process.
Step S603 reads the value of the liveness of target physical page.
Step S602 to step S603 is identical to step S402 with the step S401 in the first embodiment respectively, herein It repeats no more.
Whether step S604 judges the value of liveness of target physical page higher than recycling standard, if so, performing step S605, if it is not, then performing step S607.
After the value of liveness of target physical page is read, it can be determined that whether the value of the liveness of target physical page is high In recycling standard, the value of liveness is in active state higher than the Physical Page of recycling standard, if so, step S605 is performed, if It is no, then perform step S607.
Step S605, according to the liveness of the first amplitude reduction target physical page.
If it is determined that the value of the liveness of target physical page is higher than recycling standard, then it can be according to the first amplitude reduction object The liveness of page is managed, in embodiments of the present invention, the first amplitude can be to reduce level-one every time.
Step S606 opens timer.
Preset duration can be provided with, as duration of going back on one's word, about the setting of preset duration, please refers to second of embodiment party Formula is repeated no more in the present embodiment.
When the duration of timer record reaches preset duration, step S603 is repeated to step S604.It can be only heavy It is multiple primary, that is to say, that if repeat step S604 for the first time, still to judge that the value of the liveness of target physical page is higher than Recycling standard then no longer performs step S605, but directly exits the recovery process to target physical page, that is to say, that work The Physical Page of dynamic state is only carried out once recycling and be attempted.In order to improve organic efficiency, more memories are recycled, it is preferred that work The recycling that the Physical Page of dynamic state carries out twice or more than twice is attempted, that is to say, that can be to step S603 to step S604 It repeats twice or more than twice.
Number of repetition can be preset, and actual scene test result shows the preceding organic efficiency higher for recycling trial three times, the It is very low that organic efficiency is attempted in four times and recycling later, therefore number of repetition could be provided as three times.Alternatively, it is also possible in Occupancy setting number of repetition is deposited, memory usage is higher, and recovered frequency is more.Alternatively, in actual use, it can also basis Other considerations are configured number of repetition, do not limit herein.
Step S607 recycles target physical page.
If the value of the liveness of target physical page is not higher than recycling standard, target physical page is recycled.
Below as the method that 3rd embodiment provides, with the different situations of the value of the liveness read for the first time lift Example explanation, it is assumed that the maximum of step S603 to step S604 repeat number and is set as 3 times:
First, assume that target physical page is not accessed, and the value of liveness does not increase during trial is recycled, then:
If the value for reading the liveness of target physical page for the first time is the 4th value, then after performing step S605, target physical page The value of liveness is arranged to third value, step S603 to step S604 is repeated for the first time later, due to the value of liveness Standard is still higher than recycled, continues to reduce level-one to the value of liveness, is set as second value, repeats step for the second time later S603 to step S604 since the value of liveness is still higher than recycling standard, continues to reduce level-one to the value of liveness, be set as First value repeats step S603 to step S604 for the third time later, since the value of liveness is not higher than recycling standard, to mesh Mark Physical Page is recycled.If the value for reading the liveness of target physical page for the first time is the 4th value, then the Physical Page at least needs To repeat step S603 to step S604 three times can be recovered.
If the value for reading the liveness of target physical page for the first time is third value, then after performing step S605, target physical The value of the liveness of page is arranged to second value, step S603 is repeated for the first time later to step S604, due to liveness Value be still higher than recycling standard, continue to reduce level-one to the value of liveness, be set as the first value, repeat for the second time later Step S603 to step S604 since the value of liveness is not higher than recycling standard, recycles target physical page.If it reads for the first time The value for taking the liveness of target physical page is third value, then the Physical Page at least needs to repeat step S603 twice to step Rapid S604 can be recovered.
If the value for reading the liveness of target physical page for the first time is second value, then after performing step S605, target physical The value of the liveness of page is arranged to the first value, step S603 is repeated for the first time later to step S604, due to liveness Value not higher than recycling standard, target physical page is recycled.If the value for reading the liveness of target physical page for the first time is the Two-value, then the Physical Page is at least needed once to repeat step S603 to step S604 and can be recovered.
If the value for reading the liveness of target physical page for the first time is the first value, since the value of liveness is marked not higher than recycling Standard recycles target physical page.If the value for reading the liveness of target physical page for the first time is the first value, then the Physical Page Step S603 to step S604 is not needed to repeat with regard to that can be recovered.
As it can be seen that before the recycling step for performing the present invention, the higher Physical Page of the value of liveness is less susceptible to be returned Receive, that is to say, that the present invention can the relatively low Physical Page of priority reclamation liveness, realize to the fine of the Physical Page of active state Change classification recycling.
2nd, assume that target physical page is accessed, then the value of its liveness can increase during trial is recycled, then It is compared with the first situation, system needs more recycling to attempt that target physical page could be recycled.In practical application In, the recycling that system usually carries out Physical Page finite number of time is attempted, if after the recycling of finite number of time is attempted, target physical page The value of liveness be still higher than recycling standard, then show that the liveness of target physical page is very high, be for target process Higher Physical Page is worth, system will not recycle target physical page, be obtained between process operational effect and memory source abundance More rational balance.
Further, target process carry out recycling trial movable Physical Page include target process in ACTIVE_ Physical Page in ANON chained lists(That is the anonymous page of active state)The corresponding Physical Page in ACTIVE_FILE chained lists(It is i.e. movable The file page of state).Wherein, the way of recycling of anonymous page is exchanged for page, and time-consuming for recycling, and efficiency is low;And the recycling of file page Mode is abandoned for page or page write-back, and recycling is time-consuming short, efficient.As it can be seen that the recycling cost higher of the anonymous page to active state, Therefore it is compared with the anonymous page of active state, the recovery difficult to the file page of active state can be reduced, improve file page Probability is recycled, more file page is recycled, to improve the recycled in its entirety efficiency to movable Physical Page.
Increase the recovery difficult to the anonymous page of active state, a variety of methods may be used, for example, anonymous page can be increased Duration of going back on one's word, for example the selectable value of liveness can be reduced or reduction amplitude to liveness can also be increased.Here, The third mode is illustrated in we, if 3rd embodiment is used for the recycling of anonymous page, then refer to 7, the present invention The 4th embodiment of Memory recycle is carried out to the target process of destination application to include the following steps:
Step S701 sets the selectable value of Physical Page liveness, including the first value, second value, third value and the 4th value.
The selectable value of Physical Page liveness is set, for example the first value, second value, third value and the 4th value can be included, In, the first value is not higher than recycling standard, and second value is less than third value, and higher than recycling standard, and third value is less than the 4th value.Or It can be said that each selectable value represents the series of the liveness of Physical Page, value is higher, and the series of liveness is higher.
As an example, the active level of Physical Page can be assessed by setting flag bit, it is assumed that two flag bits of setting, The selectable value of each flag bit is 0 and 1, and the value of liveness can be used(First mark bit value, the second mark bit value)Carry out generation Table, then the selectable value of liveness includes(0,0)、(0,1)、(1,0)With(1,1), and default standard of comparison(0,0)It is less than(1, 0)It is less than(0,1)It is less than(1,1), that is to say, that(0,0)、(1,0)、(0,1)、(1,1)It increases step by step.
Step S702 obtains the corresponding target physical page of target process.
Step S703 reads the value of the liveness of target physical page.
Step S702 to step S703 is identical to step S402 with the step S401 in first embodiment respectively, herein no longer It repeats.
Whether step S704 judges the value of liveness of target physical page higher than recycling standard, if so, performing step S705, if it is not, then performing step S707.
After the value of liveness of target physical page is read, it can be determined that whether the value of the liveness of target physical page is high In recycling standard, the value of liveness is in active state higher than the Physical Page of recycling standard, if so, step S705 is performed, if It is no, then perform step S707.
Step S705, if the type of target physical page is file page, according to the work of the second amplitude reduction target physical page Jerk.
It, can be with before the liveness for reducing target physical page after the corresponding target physical page of target process is obtained The reduction amplitude of its liveness is set according to the type of target physical page.When target physical page is anonymous page, then according to the The liveness of one amplitude reduction target physical page;When target physical page is file page, then according to the second amplitude reduction object The liveness of page is managed, and the first amplitude is less than the second amplitude.In the third embodiment, the first amplitude, can be with to reduce level-one As the recovery process when target physical page is anonymous page, details are not described herein again.It is mainly used for illustrating in the present embodiment When the type of target physical page is file page, to the recovery process of target physical page.Since the first amplitude is less than the second amplitude, The second amplitude can be to reduce two-stage every time so in the present embodiment.
Step S706 opens timer.
Preset duration can be provided with, as duration of going back on one's word, about the setting of preset duration, refers to second embodiment, It is repeated no more in the embodiment of the present invention.
When the duration of timer record reaches preset duration, step S703 is repeated to step S704.It can be only heavy It is multiple primary, that is to say, that if repeat step S703 to step S704 for the first time, still to judge enlivening for target physical page The value of degree is higher than recycling standard, then no longer performs step S705, but directly exits the recovery process to target physical page, also It is to say, the Physical Page of active state is only carried out once to recycle and is attempted.In order to improve organic efficiency, more memories are recycled, it is excellent Choosing, the recycling carried out twice or more than twice to the Physical Page of active state is attempted, that is to say, that can be to step S703 extremely Step S704 is repeated twice or more than twice.
Number of repetition can be preset, and actual scene test result shows the preceding organic efficiency higher for recycling trial three times, the It is very low that organic efficiency is attempted in four times and recycling later, therefore number of repetition could be provided as three times.Alternatively, it is also possible in Occupancy setting number of repetition is deposited, memory usage is higher, and recovered frequency is more.Alternatively, in actual use, it can also basis Other considerations are configured number of repetition, do not limit herein.
Step S707 recycles target physical page.
If the value of the liveness of target physical page is not higher than recycling standard, target physical page is recycled.
Below as the method that fourth embodiment provides, with the different situations of the value of the liveness read for the first time lift Example explanation, it is assumed that the maximum of step S703 to step S704 repeat number and is set as 3 times:
First, assume that target physical page is not accessed, and the value of liveness does not increase during trial is recycled, then:
If the value for reading the liveness of target physical page for the first time is the 4th value, then after performing step S705, target physical page The value of liveness is arranged to second value, step S703 to step S704 is repeated for the first time later, due to the value of liveness Standard is still higher than recycled, continues to reduce two-stage to the value of liveness, since minimum series is the first value, is set as the One value repeats step S703 to step S704 for the second time later, since the value of liveness is not higher than recycling standard, to target Physical Page is recycled.If the value for reading the liveness of target physical page for the first time is the 4th value, then the Physical Page at least needs Repeating step S703 to step S704 twice can be recovered.
If the value for reading the liveness of target physical page for the first time is third value, then after performing step S705, target physical The value of the liveness of page is arranged to the first value, step S703 is repeated for the first time later to step S704, due to liveness Value not higher than recycling standard, target physical page is recycled.If the value for reading the liveness of target physical page for the first time is the Three values, then the Physical Page is at least needed once to repeat step S703 to step S704 and can be recovered.
If the value for reading the liveness of target physical page for the first time is second value, then after performing step S705, target physical The value of the liveness of page is arranged to the first value, step S703 is repeated for the first time later to step S704, due to liveness Value not higher than recycling standard, target physical page is recycled.If the value for reading the liveness of target physical page for the first time is the Two-value, then the Physical Page is at least needed once to repeat step S703 to step S704 and can be recovered.
If the value for reading the liveness of target physical page for the first time is the first value, since the value of liveness is marked not higher than recycling Standard recycles target physical page.If the value for reading the liveness of target physical page for the first time is the first value, then the Physical Page Step S703 to step S704 is not needed to repeat with regard to that can be recovered.
As it can be seen that before the recycling step for performing the present invention, the higher Physical Page of the value of liveness is less susceptible to be returned Receive, that is to say, that the present invention can the relatively low Physical Page of priority reclamation liveness, realize to the fine of the Physical Page of active state Change classification recycling.
Compared with third embodiment, present embodiment is advantageously reduced by increasing the reduction amplitude of the value of liveness Step S703 repeats number to step S704's, improves the organic efficiency to the file page of active state.
2nd, assume that target physical page is accessed, then the value of its liveness can increase during trial is recycled, then It is compared with the first situation, system needs more recycling to attempt that target physical page could be recycled.In practical application In, the recycling that system usually carries out Physical Page finite number of time is attempted, if after the recycling of finite number of time is attempted, target physical page The value of liveness be still higher than recycling standard, then show that the liveness of target physical page is very high, be for target process Higher Physical Page is worth, system will not recycle target physical page, be obtained between process operational effect and memory source abundance More rational balance.
It can be realized respectively to target process in work by the method for 3rd embodiment and the method for fourth embodiment The recycling of the anonymous page and file page of dynamic state, such as the following table 1 are the method according to the method and fourth embodiment of 3rd embodiment Carry out the actual scene test of page recycling.It is understood that the knot that the test data in table 1 is only once tested Fruit, when testing again, due to the use of terminal it is different, to service condition difference of application program etc., can lead to test data Variation, therefore, the data of table 1 are only used for qualitative illustrating the present invention to the recovering effect of each application rather than quantitative limiting The present invention is to the organic efficiency of each application.
Apply Names The first time rate of recovery Second of rate of recovery The third time rate of recovery 4th rate of recovery 5th rate of recovery The accumulative rate of recovery recycled three times The accumulative rate of recovery for carrying out five recycling
Bean cotyledon 2.64% 8.27% 26.73% 0.46% 0.08% 34.56% 35.00%
QQ 4.62% 33.02% 11.55% 1.90% -0.97% 43.49% 44.10%
Wechat 1.79% 12.15% 19.32% -0.04% 0.32% 30.39% 30.60%
Today's tops 5.84% 16.98% 17.35% -0.33% -0.85% 35.39% 34.70%
QQ browsers 11.72% 17.80% 6.53% 1.54% -1.94% 32.17% 32.00%
Mobile phone house keeper 4.87% 20.91% 17.58% -0.62% 0.72% 37.99% 38.10%
Using center 24.46% 18.66% 11.40% 0.23% -2.54% 45.56% 44.40%
Sina weibo 8.69% 25.51% 32.80% -0.52% -3.39% 54.29% 53.50%
Table 1
Respectively with bean cotyledon, QQ, wechat, today's tops, QQ browsers, mobile phone house keeper, using center and Sina weibo etc. application make For intended application, i.e. test object, using the process in intended application as target process, page recycling is carried out to target process, To realize the Memory recycle to intended application.By taking bean cotyledon as an example, during the test, the anonymity first to the target process of bean cotyledon Page performs a step S603 and performs a step S703 to step S704 to step S604 or to its file page, referred to as pair Bean cotyledon carries out first time recycling, after recycling according to the memory size of bean cotyledon occupancy before recycling test and for the first time in bean cotyledon occupancy Size is deposited, the first time rate of recovery to bean cotyledon can be calculated, is 2.64%;Later to the anonymous page of the target process of bean cotyledon Second of execution step S603 performs step S703 to step S704 second to step S604 or to its file page, referred to as It is recycled to carry out second to bean cotyledon, bean cotyledon accounts for after the memory size occupied according to bean cotyledon after recycling for the first time and second of recycling Second of rate of recovery to bean cotyledon can be calculated in memory size, be 8.27%;The rest may be inferred, can obtain to bean cotyledon The third time rate of recovery be 26.73%, be 0.46% to the 4th rate of recovery of bean cotyledon, be to the 5th rate of recovery of bean cotyledon 0.08%。
Observe the same application rate of recovery that homogeneous does not recycle in table 1, it can be seen that respectively apply equal in the preceding rate of recovery three times It is far longer than the rate of recovery of the 4th time and the 5th time, also, the accumulative rate of recovery recycled three times(After being recycled according to third time The memory size occupied using application before the memory size of occupancy and recycling test is calculated)With accumulative five recycling of progress The rate of recovery is not much different, and illustrates that recovered frequency is excessive, and organic efficiency is not high, and waste of resource, it is therefore preferred to application into The page recycling of row finite number of time.
In addition, the existing method recycled for process, only recycles the Physical Page of inactive state, recycle Rate corresponds to the first time rate of recovery in table 1, is carried out three times with accumulative by comparing the first time rate of recovery of same application in table 1 The rate of recovery of recycling, it is found that the latter is the former several times, and multiple is between 2 times to 17 times, it is seen then that and prior art phase Than the present invention realizes the higher rate of recovery, has positive effect for alleviating Installed System Memory pressure.
In conclusion the present invention provides a kind of method that Memory recycle is carried out for process, and can be to moving type The Physical Page of state carries out selective recovery, greatly improves the efficiency of Memory recycle.Also, due to being directed to different types of answer With program using different Memory recycle strategies, such as the more favorite application program of user, Memory recycle operation is performed Number is less, and for the relatively low application program of user's favorable rating, then the number for performing Memory recycle operation is more, so as to keep away Exempt from the more favorite application program on user influences response speed due to the operation that frequent executive process loads.
Certainly, in order to which terminal device is allowed to recycle memory in time, user can set a free memory threshold value, such as 200M, If the current memory of terminal device is less than the threshold value, terminal device operates automatic trigger Memory recycle, such as obtains terminal The destination application that equipment is currently running, and the flow such as Fig. 1 is performed, so as to fully recycle the memory of terminal device.It is excellent Choosing, system can set a threshold value given tacit consent to or by the user setting threshold value.If during by the user setting threshold value, User can set the threshold value according to actual use situation.
Further, since the speed of service of terminal device will be influenced by performing Memory recycle operation, terminal is set in order to reduce The influence of the standby speed of service, terminal device can just perform Memory recycle operation when loading smaller situation, for example, in terminal Equipment, which is in when screen lock state either ceases screen state, to be performed Memory recycle operation or is in suspend mode or non-work in terminal device Make to perform Memory recycle operation during state or Memory recycle operation is performed when the load of CPU is relatively low.Certainly, it needs to set A cpu load threshold value is put, determines that the load of CPU is relatively low when the load of CPU is less than the load threshold, can be performed at this time interior Deposit reclaimer operation.
Further, since Memory recycle operation needs to consume certain electric energy, therefore as more in terminal device electric energy as possible When perform Memory recycle operation, such as when terminal device charge or the electricity of terminal device more than power threshold when hold Row Memory recycle operates, and when the electricity of terminal device is less than preset power threshold, when being less than 20% such as remaining capacity, does not perform Memory recycle operates.
Certainly, in order to ensure the speed of service of terminal device, when the electricity of terminal device is less than power threshold, if eventually The fragment of end equipment is more or free memory is less than memory threshold, during such as 200M, still performs a Memory recycle operation.
The method for recovering internal storage in the embodiment of the present invention is described above, below to being stored back in the embodiment of the present invention Receiving apparatus is described.
Referring to Fig. 8, Memory recycle device of the invention includes:
First acquisition module 801, for obtaining the destination application being currently running.For example, by obtaining in task manager The application program being currently running list information, obtain the destination application that is currently running of terminal device.
Judgment module 802, for judging whether destination application is Memory recycle protection application program, specifically, sentencing Whether disconnected module 802 obtains the running frequency of destination application, judge the running frequency of destination application higher than default fortune Line frequency;Alternatively, judging whether destination application is the application program preset in Memory recycle protection list;Alternatively, judge Destination application whether be preset kind application program.
If it is determined that module determines that the running frequency of destination application is higher than preset running frequency or determining target Application program is application program in default Memory recycle protection list or determining destination application is preset kind Application program, it is determined that destination application is Memory recycle protection application program, otherwise, it determines destination application is not interior It is stored back to receipts protection application program.
Memory recycle module 803, for when it is Memory recycle protection application program to determine destination application, presetting The Memory recycle operation for being not more than the first preset times is performed in time span to destination application;And determining intended application When program is not Memory recycle protection application program, it is pre- that no less than second is performed to destination application in predetermined time period If destination application is closed in the Memory recycle operation of number;Wherein, the first preset times are less than the second preset times.
Specifically, Memory recycle module 803 obtains after determining that destination application is not Memory recycle protection application program The memory value that destination application is taken to occupy, judges whether the memory value that destination application occupies is more than default memory value, such as It is then to perform the Memory recycle operation for being no less than the second preset times to destination application in predetermined time period, otherwise, Close destination application.
As it can be seen that the present invention performs the less reclaimer operation of number to Memory recycle protection application program, and for not being interior Receipts protection application program is stored back to, when the memory value that destination application occupies is larger, performs the more Memory recycle behaviour of number Make, and when the memory value that destination application occupies is less, directly destination application is closed, to discharge as far as possible more More memories.
Preferably, it is to perform several times when Memory recycle module 803 performs destination application Memory recycle operation , and interval time is set between the operation of adjacent Memory recycle twice.A kind of situation is, is not interior for destination application When being stored back to receipts protection application program, the second preset times after a Memory recycle operation is performed, are passed through for more than secondary After first interval time, perform Memory recycle next time and operate.
And for destination application be Memory recycle protection application program when, to intended application in predetermined time period Program performs secondary above Memory recycle operation, also, after Memory recycle operation of execution, by the second interval time Afterwards, Memory recycle next time is performed to operate, also, the second interval time was more than for the first interval time.
Memory recycle module 803 can be there are many realization method, and a kind of concrete implementation mode is as shown in figure 9, the present invention The first embodiment of Memory recycle module 803 includes in embodiment:
Second acquisition module 901, for obtaining the corresponding target process of destination application, and it is corresponding to obtain target process Target physical page.
First read module 902, for reading the value of the liveness of target physical page, the liveness of target physical page is used for Marking target manages the active level of page, the value of the liveness of target physical page and the active level positive correlation of target physical page.
Module 903 is reduced, for when the value of the liveness of target physical page is higher than recycling standard, reducing target physical page Liveness, also, the value of liveness is in active state higher than the Physical Page of recycling standard.
Second read module 904, for reducing the liveness of module reduction target physical page and then secondary reading target The value of the liveness of Physical Page.
Recycling module 905, for when the value of the liveness of target physical page is not higher than recycling standard, recycling target physical Page.
Figure 10 is referred to, 803 second embodiment of Memory recycle module includes in the embodiment of the present invention:
Third acquisition module 1001, for obtaining the corresponding target process of destination application, and it is corresponding to obtain target process Target physical page.
First read module 1002, for reading the value of the liveness of target physical page, the liveness of target physical page is used In the active level of marking target reason page, the value of the liveness of target physical page and the active level positive of target physical page It closes.
Module 1003 is reduced, for when the value of the liveness of target physical page is higher than recycling standard, reducing target physical The liveness of page, the value of liveness are in active state higher than the Physical Page of recycling standard.
Preferably, module 1003 is reduced to include setting unit 1004 and reduce unit 1005, wherein, setting unit 1004 are used to, when the liveness of target physical page is third value, the liveness of target physical page is set as second value;Work as mesh When the liveness for marking Physical Page is second value, the liveness of target physical page is set as the first value.Unit 1005 is reduced to be used for When target physical page is anonymous page, according to the liveness of the first amplitude reduction target physical page;When target physical page is file During page, according to the liveness of the second amplitude reduction target physical page;Also, the first amplitude is less than the second amplitude.
Second setup module 1006, for timing module 1007 open timer before, according to the preferential of target process Grade setting preset duration, the priority positive correlation of preset duration and target process.
Timing module 1007, for after the liveness for reducing target physical page, reading enlivening for target physical page Before the value of degree, timer is opened.
Second read module 1008, for after the liveness for reducing module reduction target physical page, reading object Manage the value of the liveness of page.
Recycling module 1009, for when the value of the liveness of target physical page is not higher than recycling standard, recycling object Manage page.
In actual use, the second setup module can not also be used, but uses the first setup module, the first setting mould Block is used for before timing module opens timer, and preset duration, preset duration and EMS memory occupation are set according to memory usage Rate is negatively correlated.
The embodiment of the present invention additionally provides a kind of terminal, as shown in figure 11, for convenience of description, illustrates only and the present invention The relevant part of embodiment, particular technique details do not disclose, please refer to present invention method part.The terminal device can Think including mobile phone, tablet computer, personal digital assistant(English full name:Personal Digital Assistant, English contracting It writes:PDA)Etc. arbitrary terminal device.
With reference to figure 11, terminal device includes:Power supply 1103, memory 1102, processor 1101 and it is stored in memory In and the computer program that can run on a processor.Wherein, it is realized when processor 1101 performs computer program above-mentioned each Step in information processing method embodiment, such as step S101 to S106 shown in FIG. 1 etc..Alternatively, processor performs calculating Each module or the function of unit in above-mentioned each device embodiment are realized during machine program.
Illustratively, computer program can be divided into one or more module/units, and one or more module/ Unit is stored in memory, and is performed by processor, to complete the present invention.Above-mentioned one or more module/units can To be the series of computation machine program instruction section that can complete specific function, the instruction segment is for describing computer program in terminal Implementation procedure in equipment.
It, can be with it will be understood by those skilled in the art that the structure shown in Figure 11 does not form the restriction to terminal device Including either combining certain components or different components arrangement, terminal as escribed above than illustrating more or fewer components Equipment can also include input-output equipment, network access equipment, bus etc..
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it His general processor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic device Part, discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processing Device etc., processor are the control centres of terminal device, utilize the various pieces of various interfaces and the entire terminal device of connection.
Memory can be used for storage computer program and/or module, processor to be stored in memory by running or performing Interior computer program and/or module and calling are stored in the data in memory, realize the various functions of terminal device. Memory can mainly include storing program area and storage data field, wherein, storing program area can storage program area, at least one Application program needed for function(Such as sound-playing function, image player function etc.)Deng;Storage data field can be stored according to hand Machine uses created data(Such as audio data, phone directory etc.)Deng.In addition, memory can include high random access Memory can also include nonvolatile memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card(Smart Media Card, SMC), secure digital(Secure Digital, SD)Card, flash card(Flash Card), at least one magnetic Disk storage device, flush memory device or other volatile solid-state parts.
If module/unit that terminal device integrates is realized in the form of SFU software functional unit and is independent product pin It sells or in use, can be stored in a computer read/write memory medium.Based on such understanding, the present invention realizes above-mentioned All or part of flow in embodiment method can also instruct relevant hardware to complete by computer program, calculate Machine program can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned The step of each embodiment of the method.Wherein, computer program includes computer program code, and computer program code can be source Code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable medium can include:It can Carry any entity of computer program code or device, recording medium, USB flash disk, mobile hard disk, magnetic disc, CD, computer storage Device, read-only memory(ROM, Read-Only Memory), random access memory(RAM, Random Access Memory)、 Electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the content that computer-readable medium includes can To carry out appropriate increase and decrease, such as in certain jurisdictions, root according to legislation in jurisdiction and the requirement of patent practice According to legislation and patent practice, computer-readable medium does not include electric carrier signal and telecommunication signal.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit can refer to the corresponding process in preceding method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, Ke Yitong Other modes are crossed to realize.For example, the apparatus embodiments described above are merely exemplary, for example, said units are drawn Point, only a kind of division of logic function can have other dividing mode, such as multiple units or component can in actual implementation To combine or be desirably integrated into another system or some features can be ignored or does not perform.Another point, it is shown or beg for The mutual coupling, direct-coupling or communication connection of opinion can be the INDIRECT COUPLING by some interfaces, device or unit Or communication connection, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit Component may or may not be physical unit, you can be located at a place or can also be distributed to multiple networks On unit.Some or all of unit therein can be selected according to the actual needs to realize the purpose of this embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If integrated unit realized in the form of SFU software functional unit and be independent product sale or in use, can To be stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention substantially or Saying all or part of the part contribute to the prior art or the technical solution can be embodied in the form of software product Out, which is stored in a storage medium, is used including some instructions so that a computer equipment (Can be personal computer, server or the network equipment etc.)Perform all or part of each embodiment method of the present invention Step.And aforementioned storage medium includes:USB flash disk, mobile hard disk, read-only memory(ROM, Read-Only Memory), it is random Access memory(RAM, Random Access Memory), various Jie that can store program code such as magnetic disc or CD Matter.
Certainly, above-mentioned scheme is the preferred embodiment of the invention, and practical application is that can also have more variations, For example, the set-up mode of pending information changes, the change to the invisible mode of pending information, such change not shadow The implementation of the present invention is rung, should also be included within the scope of the present invention.

Claims (10)

1. a kind of method for recovering internal storage, applied to terminal device, which is characterized in that this method includes:
The destination application being currently running is obtained, judges whether the destination application is that journey is applied in Memory recycle protection Sequence;
The destination application as described in determining is Memory recycle protection application program, should to the target in predetermined time period The Memory recycle operation for being not more than the first preset times is performed with program;
The destination application as described in determining is not Memory recycle protection application program, to described in the predetermined time period Destination application performs the Memory recycle operation for being no less than the second preset times or closes the destination application;
Wherein, first preset times are less than or equal to second preset times.
2. method for recovering internal storage according to claim 1, which is characterized in that it is interior be stored back to determine the destination application Protection application program is received to include:
The running frequency of the destination application is obtained, determines the running frequency of the destination application higher than default operation Frequency;Alternatively,
It is the application program in default Memory recycle protection list to determine the destination application;Alternatively,
Determine the application program that the destination application is preset kind.
3. method for recovering internal storage according to claim 1 or 2, which is characterized in that determine that the destination application is not Memory recycle protects application program, and it is default to perform no less than second to the destination application in the predetermined time period The Memory recycle of number, which operates or closes the destination application, to be included:
It is not after Memory recycle protects application program to determine the destination application, obtains what the destination application occupied Memory value, judges whether the memory value that the destination application occupies is more than default memory value, if so, then when described default Between the destination application is performed in length and is no less than the Memory recycles of the second preset times and operates, otherwise, described in closing Destination application.
4. method for recovering internal storage according to claim 1 or 2, which is characterized in that second preset times for it is secondary with On;
The Memory recycle behaviour for being no less than the second preset times is performed to the destination application in the predetermined time period Work includes:
After performing the primary Memory recycle operation, after the first interval time, the Memory recycle operation next time is performed.
5. method for recovering internal storage according to claim 4, which is characterized in that should to the target in predetermined time period The Memory recycle operation that not more than the first preset times are performed with program includes:To the target in the predetermined time period Application program performs secondary above Memory recycle operation, also,
After performing the primary Memory recycle operation, after the second interval time, the Memory recycle operation next time is performed;
Second interval time is more than first interval time.
6. method for recovering internal storage according to claim 1 or 2, which is characterized in that in being performed to the destination application Reclaimer operation is deposited to include:
The target process that the destination application is currently running is obtained, and obtains the corresponding target physical of the target process Page;
The value of the liveness of the target physical page is read, the liveness of the target physical page is used to mark the target physical The active level of page, the value of the liveness of the target physical page and the active level positive correlation of the target physical page;
If the value of the liveness of the target physical page is higher than recycling standard, and the value of liveness is higher than the object of the recycling standard Reason page is in active state, then reduces the liveness of the target physical page;
Read again the value of the liveness of the target physical page;
If the value of the liveness of the target physical page is not higher than the recycling standard, the target physical page is recycled.
7. a kind of Memory recycle device, applied to terminal device, which is characterized in that the device includes:
Acquisition module, for obtaining the destination application being currently running;
Judgment module, for judging whether the destination application is Memory recycle protection application program;
Memory recycle module, for determine the destination application be Memory recycle protection application program when, when default Between the destination application is performed in length and is not more than the Memory recycles of the first preset times and operates;And determining the mesh When mark application program is not Memory recycle protection application program, the destination application is held in the predetermined time period Row is no less than the Memory recycle operation of the second preset times or closes the destination application;
Wherein, first preset times are less than second preset times.
8. Memory recycle device according to claim 7, which is characterized in that the judgment module is specifically used for:
The running frequency of the destination application is obtained, judges the running frequency of the destination application whether higher than default Running frequency;Alternatively,
Judge whether the destination application is the application program preset in Memory recycle protection list;Alternatively,
Judge the destination application whether be preset kind application program.
9. a kind of terminal device, which is characterized in that the terminal device includes processor, and the processor is used to perform memory It is realized during the computer program of middle storage as described in any one in claim 1 to 6 the step of method for recovering internal storage.
10. a kind of computer readable storage medium, is stored thereon with computer program, it is characterised in that:The computer program It is realized when being executed by processor as described in any one in claim 1 to 6 the step of method for recovering internal storage.
CN201710668172.XA 2017-08-07 2017-08-07 Memory recovery method and device, terminal equipment and computer readable storage medium Active CN108228341B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710668172.XA CN108228341B (en) 2017-08-07 2017-08-07 Memory recovery method and device, terminal equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710668172.XA CN108228341B (en) 2017-08-07 2017-08-07 Memory recovery method and device, terminal equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108228341A true CN108228341A (en) 2018-06-29
CN108228341B CN108228341B (en) 2021-03-02

Family

ID=62654112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710668172.XA Active CN108228341B (en) 2017-08-07 2017-08-07 Memory recovery method and device, terminal equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108228341B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109358955A (en) * 2018-09-27 2019-02-19 联想(北京)有限公司 Process management method and device
CN109857555A (en) * 2019-01-15 2019-06-07 Oppo广东移动通信有限公司 Method for recovering internal storage and device, storage medium and electronic equipment
CN110543365A (en) * 2019-08-20 2019-12-06 Oppo广东移动通信有限公司 Memory optimization method and device, computer readable medium and electronic device
WO2021072716A1 (en) * 2019-10-17 2021-04-22 深圳市欢太科技有限公司 Memory management method and apparatus, electronic device and computer-readable medium
WO2021254200A1 (en) * 2020-06-16 2021-12-23 北京紫光展锐通信技术有限公司 Page thrashing protection method and apparatus for memory reclaim of operating system
WO2023019691A1 (en) * 2021-08-20 2023-02-23 深圳市江波龙电子股份有限公司 Storage device and data recovery method therefor, control device, and readable storage medium
CN116361200A (en) * 2022-09-30 2023-06-30 荣耀终端有限公司 Memory garbage recycling method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092700A (en) * 2013-02-01 2013-05-08 华为终端有限公司 Internal memory cleaning method and cleaning device and terminal device
CN104484282A (en) * 2014-12-31 2015-04-01 广东欧珀移动通信有限公司 Internal storage recovery method and device
WO2015132753A1 (en) * 2014-03-07 2015-09-11 Eco4Cloud S.R.L. Method for memory management in virtual machines, and corresponding system and computer program product
CN105159777A (en) * 2015-08-03 2015-12-16 中科创达软件股份有限公司 Process memory collection method and apparatus
CN105701025A (en) * 2015-12-31 2016-06-22 华为技术有限公司 Memory recovery method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092700A (en) * 2013-02-01 2013-05-08 华为终端有限公司 Internal memory cleaning method and cleaning device and terminal device
WO2015132753A1 (en) * 2014-03-07 2015-09-11 Eco4Cloud S.R.L. Method for memory management in virtual machines, and corresponding system and computer program product
CN104484282A (en) * 2014-12-31 2015-04-01 广东欧珀移动通信有限公司 Internal storage recovery method and device
CN105159777A (en) * 2015-08-03 2015-12-16 中科创达软件股份有限公司 Process memory collection method and apparatus
CN105701025A (en) * 2015-12-31 2016-06-22 华为技术有限公司 Memory recovery method and device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109358955A (en) * 2018-09-27 2019-02-19 联想(北京)有限公司 Process management method and device
CN109857555A (en) * 2019-01-15 2019-06-07 Oppo广东移动通信有限公司 Method for recovering internal storage and device, storage medium and electronic equipment
CN109857555B (en) * 2019-01-15 2023-02-28 Oppo广东移动通信有限公司 Memory recovery method and device, storage medium and electronic equipment
CN110543365A (en) * 2019-08-20 2019-12-06 Oppo广东移动通信有限公司 Memory optimization method and device, computer readable medium and electronic device
CN110543365B (en) * 2019-08-20 2024-01-09 Oppo广东移动通信有限公司 Memory optimization method and device, computer readable medium and electronic equipment
WO2021072716A1 (en) * 2019-10-17 2021-04-22 深圳市欢太科技有限公司 Memory management method and apparatus, electronic device and computer-readable medium
WO2021254200A1 (en) * 2020-06-16 2021-12-23 北京紫光展锐通信技术有限公司 Page thrashing protection method and apparatus for memory reclaim of operating system
WO2023019691A1 (en) * 2021-08-20 2023-02-23 深圳市江波龙电子股份有限公司 Storage device and data recovery method therefor, control device, and readable storage medium
CN116361200A (en) * 2022-09-30 2023-06-30 荣耀终端有限公司 Memory garbage recycling method and electronic equipment
CN116361200B (en) * 2022-09-30 2023-11-14 荣耀终端有限公司 Memory garbage recycling method and electronic equipment

Also Published As

Publication number Publication date
CN108228341B (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN108228341A (en) Method for recovering internal storage and device, terminal device and computer readable storage medium
CN108228449A (en) Terminal equipment control method and device, terminal device and computer readable storage medium
CN106293924B (en) The EMS memory management process and device of Android system
CN104866366B (en) Application program method for cleaning and device
CN111324303B (en) SSD garbage recycling method, SSD garbage recycling device, computer equipment and storage medium
CN106933733A (en) A kind of method and apparatus for determining RAM leakage position
CN104346286B (en) Data storage device and flash memory control method
CN108205498B (en) Memory recovery method and device, computer device and computer readable storage medium
CN108205471B (en) Memory recovery method and device, computer device and computer readable storage medium
CN108205473A (en) Internal memory processing method and device, computer installation and computer readable storage medium
CN108228342A (en) Terminal equipment control method and device, terminal device and computer readable storage medium
CN108063818A (en) Data download method, device, terminal and computer readable storage medium
KR101591601B1 (en) Memory omtimized method and uesr device for performing the method
CN108228339A (en) A kind of method for recovering internal storage and device, terminal device and computer readable storage medium
CN108287760A (en) Terminal equipment control method and device, terminal device and computer readable storage medium
CN108287761A (en) Method for recovering internal storage and device, terminal device and computer readable storage medium
CN105893471A (en) Data processing method and electronic equipment
CN108205501A (en) Method for recovering internal storage and device, computer installation and computer readable storage medium
CN107305478A (en) Storage device, control unit thereof and data storage method for storage device
CN106909424A (en) The startup control method and device of a kind of application program
CN104375944A (en) Method and device for storing data
CN107402791A (en) Applied program processing method, device, storage medium and terminal
CN104951370B (en) A kind of EMS memory management process and device
CN106228074A (en) storage object aging method and device
CN108228340A (en) terminal control method and device, terminal device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant