CN104536907B - A kind of memory method for cleaning and electronic equipment - Google Patents

A kind of memory method for cleaning and electronic equipment Download PDF

Info

Publication number
CN104536907B
CN104536907B CN201510037517.2A CN201510037517A CN104536907B CN 104536907 B CN104536907 B CN 104536907B CN 201510037517 A CN201510037517 A CN 201510037517A CN 104536907 B CN104536907 B CN 104536907B
Authority
CN
China
Prior art keywords
application
memory
cleaning
resource
common
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510037517.2A
Other languages
Chinese (zh)
Other versions
CN104536907A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201510037517.2A priority Critical patent/CN104536907B/en
Publication of CN104536907A publication Critical patent/CN104536907A/en
Application granted granted Critical
Publication of CN104536907B publication Critical patent/CN104536907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

A kind of memory method for cleaning of offer of the embodiment of the present invention and electronic equipment, wherein method include:When determining that meeting memory clears up condition, the memory source that each application in setting operating status currently occupies is determined;According to each apply the memory source that currently occupies, and corresponding resource thresholding is respectively applied in setting, determines that the memory source occupied is more than the intended application of corresponding resource thresholding, one of application is corresponding, and there are one resource thresholdings;Memory cleaning is carried out to the intended application.The embodiment of the present invention can carry out memory cleaning according to the service condition of application, reduce the waste to the system resource of electronic equipment.

Description

A kind of memory method for cleaning and electronic equipment
Technical field
The present invention relates to data scrubbing technical fields, more specifically to a kind of memory method for cleaning and electronic equipment.
Background technology
Memory cleaning refers to that cleaning, the release of memory source are carried out to the application of committed memory resource so that electronic equipment The mode that current free memory resource increases;With the use of electronic equipment, electronic equipment is installed interior using what is occupied Deposit resource will be more and more, and the free memory resource for electronic equipment occur cannot be satisfied the use demand of electronic apparatus system Phenomenon increases the use burden of electronic apparatus system.Therefore when the memory source that application occupies is more, reply application occupies Memory source carry out cleaning release so that more available resources can be used in electronic apparatus system.
The mode of the memory cleaning of electronic equipment is mainly at present:OMK (out of memory killer, memory are set Deficiency cleaning) treatment mechanism, however OMK is when carrying out memory cleaning, only to non-common application progress memory cleaning, and for Common application, such as the common application of desktop application, phone application, contact application will not carry out memory cleaning;These are common Using although there are the longer characteristics of usage time, its vast resources loaded is not to use in real time, this results in electronics The waste of the system resource of equipment;Therefore a kind of memory method for cleaning is provided, memory cleaning is carried out according to the service condition of application, The problem of to reduce the waste of the system resource of electronic equipment, become those skilled in the art's urgent need to resolve.
Invention content
In view of this, a kind of memory method for cleaning of offer of the embodiment of the present invention and electronic equipment, do not have to solve the prior art The service condition of with good grounds application carries out the problem of memory cleaning.
To achieve the above object, the embodiment of the present invention provides the following technical solutions:
A kind of memory method for cleaning is applied to electronic equipment, including:
When determining that meeting memory clears up condition, the memory money that each application in setting operating status currently occupies is determined Source;
It according to each applies the memory source that currently occupies, and corresponding resource thresholding is respectively applied in setting, determines and occupy Memory source is more than the intended application of corresponding resource thresholding, and one of application is corresponding, and there are one resource thresholdings;
Memory cleaning is carried out to the intended application.
Wherein, the intended application includes common intended application and non-common intended application;It is described to the intended application Carrying out memory cleaning includes:
Memory cleaning is carried out to non-common intended application;
If after carrying out memory cleaning to non-common intended application, the free memory resource of the electronic equipment reaches default money The normal thresholding in source is then cancelled and carries out memory cleaning to common intended application;
If after carrying out memory cleaning to non-common intended application, the free memory resource of the electronic equipment is not up to default The normal thresholding of resource then continues to carry out memory cleaning to common intended application.
Wherein, memory source that respectively application currently occupy of the determination in setting operating status includes:
Determine the memory source that the application in background operation state or non-data download state currently occupies.
Wherein, include using the setting process of corresponding resource thresholding respectively:
The resource use value for choosing application and the selected application of definition, selected application and defined resource are made It is associated with value, determines that associated resource use value is the selected corresponding resource thresholding of application.
Wherein, include using the setting process of corresponding resource thresholding respectively:
Determine each history usage time applied in set period of time;
If there are the applications that history usage time is more than setting first time, when history usage time is more than setting first Between the resource thresholding of application Secondary resource use value is set as by current first resource use value, Secondary resource use value is big In first resource use value;
If there are the applications that history usage time is less than the second time of setting, when history usage time is less than setting second Between the resource thresholding of application the 4th resource use value is set as by current information resources use value, the 4th resource use value is small In information resources use value, the second time was less than at the first time.
Wherein, the determination meet memory cleaning condition include:
It is in and goes out screen state in the electronic equipment, and when currently available memory source is less than set memory resource thresholding, It determines and meets memory cleaning condition;
Or, when detecting that user clicks the first icon shown by the display screen of the electronic equipment, determines and meet Memory clears up condition, and first icon is to carry out memory to clear up corresponding icon.
Wherein, described to include to intended application progress memory cleaning:
Determine the cleaning grade for the application being cleaned;
If the cleaning grade for the application being cleaned is the first estate, memory is carried out to the application being cleaned and uses data Cleaning;
If the cleaning grade for the application being cleaned is the second grade, the application to being cleaned, wherein the first estate are killed Higher than the second grade.
Wherein, the method further includes:
After killing the application being cleaned, if killed application is common application, killed common application is restarted, If killed application is non-common application, killed non-common application is restarted in cancellation.
The embodiment of the present invention also provides a kind of electronic equipment, including:
First determining module, for when determining that meeting memory clears up condition, determining respectively answering in setting operating status With the memory source currently occupied;
Corresponding money is respectively applied in second determining module, the memory source for currently being occupied according to each application, and setting Source thresholding determines that the memory source occupied is more than the intended application of corresponding resource thresholding, there are one one of application is corresponding Resource thresholding;
Cleaning modul, for carrying out memory cleaning to the intended application.
Wherein, the cleaning modul includes:
Unit is cleared up in non-common application, for carrying out memory cleaning to non-common intended application;
Cancel cleaning unit, if after for carrying out memory cleaning to non-common intended application, the electronic equipment can be used Memory source reaches the normal thresholding of default resource, then cancels and carry out memory cleaning to common intended application;
Common application cleaning unit, if after for carrying out memory cleaning to non-common intended application, the electronic equipment The free memory resource not up to normal thresholding of default resource, then continue to carry out memory cleaning to common intended application.
Based on the above-mentioned technical proposal, memory method for cleaning provided in an embodiment of the present invention can clear up condition meeting memory When, it determines the memory source that each application in setting operating status currently occupies, applies the memory currently occupied to provide according to each Corresponding resource thresholding is respectively applied in source and setting, determines that the memory source occupied is more than the target of corresponding resource thresholding and answers With one of application is corresponding, and there are one resource thresholdings, to carry out memory cleaning to intended application.The embodiment of the present invention passes through For the corresponding resource thresholding of each application settings, when carrying out memory cleaning, memory that the embodiment of the present invention only will be occupied currently Resource is more than the application that itself can occupy resource thresholding (i.e. corresponding resource thresholding) of setting as intended application, to only right Intended application is cleared up, without clearing up other non-targeted applications;As it can be seen that the embodiment of the present invention is when carrying out memory cleaning, It is to choose in setting operating status, and the memory source currently occupied is more than the application that itself can occupy resource thresholding of setting It is cleared up, so that the memory source that common application currently occupies is more than when itself can occupy resource thresholding of setting, this Inventive embodiments also will carry out memory cleaning to common application, reduce the system resource that do not clear up to electronic equipment of common application Waste.The embodiment of the present invention realizes the purpose that memory cleaning is carried out according to the service condition of application, reduces and is set to electronics The waste of standby system resource.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is the flow chart of memory method for cleaning provided in an embodiment of the present invention;
Fig. 2 is another flow chart of memory method for cleaning provided in an embodiment of the present invention;
Fig. 3 is another flow chart of memory method for cleaning provided in an embodiment of the present invention;
Fig. 4 is the another flow chart of memory method for cleaning provided in an embodiment of the present invention;
Fig. 5 is the flow chart of the setting method provided in an embodiment of the present invention using corresponding resource thresholding;
Fig. 6 is the structure diagram of electronic equipment provided in an embodiment of the present invention;
Fig. 7 is the structure diagram of cleaning modul provided in an embodiment of the present invention;
Fig. 8 is the structure diagram of the first determining module provided in an embodiment of the present invention;
Fig. 9 is another structure diagram of electronic equipment provided in an embodiment of the present invention;
Figure 10 is another structure diagram of cleaning modul provided in an embodiment of the present invention;
Figure 11 is another structure diagram of electronic equipment provided in an embodiment of the present invention;
Figure 12 is the another structure diagram of electronic equipment provided in an embodiment of the present invention;
Figure 13 is another structure diagram again of electronic equipment provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is the flow chart of memory method for cleaning provided in an embodiment of the present invention, and this method can be applied to electronic equipment, electricity Sub- equipment can such as equipment of mobile phone, tablet computer, laptop with data-handling capacity;Referring to Fig.1, this method can To include:
Step S100, when determining that meeting memory clears up condition, determine that each application in setting operating status currently accounts for Memory source;
It can be the pre-set condition for carrying out memory cleaning that memory, which clears up condition, as electronic equipment can show one It carries out the icon of memory cleaning for triggering (including a certain memory in desktop suspended window, electronic equipment house keeper's software clears up control The icon etc. of part), when the icon is clicked by user, then it can determine that the current memory that meets clears up condition, the icon of the type exists It can be described as the first icon in the embodiment of the present invention;Also can set memory resource thresholding, when the free memory resource of electronic equipment is small When the set memory resource thresholding, it is determined that current to meet memory cleaning condition, automatic progress memory cleaning;Can also timing into Row memory is cleared up, and by the way that timer is arranged, when the timing of timer reaches setting time, it is clear that determination currently meets memory Manage bar part, then restarts timer, realizes automatic memory cleaning at regular intervals;Obviously, item is cleared up above for memory The explanation of part is merely illustrative, and memory, which clears up condition, to carry out self-defined setting according to practical situations.
The application for setting operating status can be the application of running background, due to the application of front stage operation be user currently just In the application used, current user's use demands will be influenced if carrying out memory release, therefore set the application of operating status Can be the application of running background, subsequently to carry out memory cleaning to the application of running background;
Obviously, the application for setting operating status can also be the application of non-data download state, if there is currently data The application of download state, then it represents that user currently has download demand, if the application to data download state carries out memory cleaning, The downloading task for leading to user can not be completed in time, influence user's use, therefore the application for setting operating status can be non- The application of data download state, subsequently to carry out memory cleaning to the application of non-data download state;
The operating status of setting can also be other operating statuses of application, such as unmusical broadcast state of audio-visual application Deng;For the operating status of setting, the embodiment of the present invention can carry out self-defined setting according to practical situations.
Step S110, the memory source currently occupied according to each application, and what is set respectively apply corresponding resource thresholding, really Surely the memory source occupied is more than the intended application of corresponding resource thresholding, and one of application is corresponding, and there are one resource thresholdings;
Optionally, corresponding resource thresholding can be arranged to each application in the embodiment of the present invention, indicate what each application can occupy Resource thresholding, after determining the application in setting operating status, the embodiment of the present invention can currently account for identified each application Memory source is compared with the corresponding resource thresholding that it is arranged, if the memory source currently occupied in the presence of application is more than The application of its corresponding resource thresholding, it is determined that the application is intended application, need to carry out memory cleaning to intended application;If using The memory source currently occupied is not more than its corresponding resource thresholding, it is determined that such application is non-targeted application, subsequently not Memory cleaning need to be carried out to it;
As can be seen that for identified each application in setting operating status, it is each using the memory currently occupied money Source is compared with using itself corresponding resource thresholding, to which the memory source currently occupied is more than corresponding resource door The application of limit, is determined as intended application;As defined is in the application for setting operating status as A and B, is preset using A Corresponding resource thresholding be a1, using the preset corresponding resource thresholdings of B be b1, it is identified currently occupied using A in It is a to deposit resource, if a is more than a1, it is determined that A is intended application, memory cleaning need to be subsequently being carried out, if a is not more than a1, it is determined that A is non-targeted application, can subsequently be cleared up without memory;It is similar for the disposition of application B, it is identified to apply B The memory source currently occupied is b, if b is more than b1, it is determined that B is intended application, memory cleaning need to be subsequently being carried out, if b is not More than b1, it is determined that B is non-targeted application, can subsequently be cleared up without memory.
Step S120, memory cleaning is carried out to the intended application.
Memory method for cleaning provided in an embodiment of the present invention can be determined when meeting memory cleaning condition in setting fortune The memory source that each application of row state currently occupies, according to each application pair of each memory source and setting applied and currently occupied The resource thresholding answered determines that the memory source occupied is more than the intended application of corresponding resource thresholding, and one of application corresponds to There are one resource thresholdings, to carry out memory cleaning to intended application.The embodiment of the present invention for each application settings by corresponding to Resource thresholding, when carrying out memory cleaning, the embodiment of the present invention only by the memory source currently occupied be more than setting itself The application of resource thresholding (i.e. corresponding resource thresholding) can be occupied as intended application, so that only intended application is cleared up, Without clearing up other non-targeted applications;As it can be seen that the embodiment of the present invention is chosen in setting operation State, and the memory source currently occupied is more than the application that itself can occupy resource thresholding set and is cleared up, so that Common that the memory source currently occupied is applied to be more than when itself can occupy resource thresholding of setting, the embodiment of the present invention also will be to normal Memory cleaning is carried out with application, reduces the waste that do not clear up to the system resource of electronic equipment of common application.The present invention is implemented Example realizes the purpose that memory cleaning is carried out according to the service condition of application, reduces the wave to the system resource of electronic equipment Take.
Optionally, if identified intended application includes common application and non-common application, the embodiment of the present invention can Memory cleaning first is carried out to non-common application, if after carrying out memory cleaning to non-common application, system free memory is higher, then Without the memory cleaning of common application, retain the operation of common application;If after carrying out memory cleaning to non-common application, it is It unites free memory or relatively low, then carries out the memory cleaning of common application, lifting system free memory again.In the embodiment of the present invention In, the common application in intended application can be described as common intended application, and the non-common application in intended application can be described as non-common Intended application.
Fig. 2 shows another flow of memory method for cleaning provided in an embodiment of the present invention, with reference to Fig. 2, this method can be with Including:
Step S200, when determining that meeting memory clears up condition, determine that each application in setting operating status currently accounts for Memory source, the identified application in setting operating status includes common application and non-common application;
Step S210, the memory source currently occupied according to each application, and what is set respectively apply corresponding resource thresholding, really Surely the memory source occupied is more than the intended application of corresponding resource thresholding, and one of application is corresponded to there are one resource thresholding, Identified intended application includes common intended application and non-common intended application;
Step S220, memory cleaning is carried out to non-common intended application;
Step S230, judge the free memory resource of the electronic equipment after cleaning, if it is more than the normal thresholding of default resource, If so, step S240 is executed, if it is not, executing step S250;
Point between the default normal thresholding of the resource high system free memory resource indicated and low system free memory resource Dividing value, can configure according to electronic equipment physical memory hardware parameter and the software service condition etc. of electronic equipment is set, Can such as be arranged resource normal door be limited to it is 40% available, 30% can use.
Step S240, cancel and memory cleaning is carried out to common intended application;
Step S250, continue to carry out memory cleaning to common intended application.
After carrying out memory cleaning to non-common intended application, if the not up to default money of the free memory resource of electronic equipment The normal thresholding in source, then it represents that also need to carry out the memory cleaning of common intended application, to promote the free memory resource of electronic equipment.
Optionally, when carrying out memory cleaning to intended application, the embodiment of the present invention can be also arranged between different application Clear up grade so that certain applications only cleaning memory uses data, certain applications then directly to kill;Concrete application grade is set It is fixed, self-defined setting can be carried out according to actual conditions.
Fig. 3 shows another flow of memory method for cleaning provided in an embodiment of the present invention, and with reference to Fig. 3, this method can be with Including:
Step S300, when determining that meeting memory clears up condition, determine that each application in setting operating status currently accounts for Memory source;
Step S310, the memory source currently occupied according to each application, and what is set respectively apply corresponding resource thresholding, really Surely the memory source occupied is more than the intended application of corresponding resource thresholding, and one of application is corresponding, and there are one resource thresholdings;
Step S320, the cleaning grade for the application being cleaned is determined;
Optionally, the application being cleaned can be identified all intended applications;First non-common target can also be answered It is used as the application being cleaned, the free memory resource of electronic equipment is not more than default resource normal door and prescribes a time limit after the cleaning, then Using common intended application as the application being cleaned;
If the cleaning grade for application step S330, being cleaned is the first estate, memory is carried out to the application being cleaned Use the cleaning of data;
Memory will directly be applied and be killed using the cleaning that the cleaning of data is to applying the data occupied in memory Extremely, memory can be cleared up using the cleaning of data such as GC (Garbage Collection, garbage reclamation), cache (caching) Cleaning etc..
If the cleaning grade for application step S340, being cleaned is the second grade, the application to being cleaned is killed, wherein The first estate is higher than the second grade.
Optionally, method shown in Fig. 3 also can first clear up non-common intended application, subsequently judge whether again to common Intended application is cleared up;Corresponding, Fig. 4 shows the another flow of memory method for cleaning provided in an embodiment of the present invention, ginseng According to Fig. 4, this method may include:
Step S400, when determining that meeting memory clears up condition, determine that each application in setting operating status currently accounts for Memory source, the identified application in setting operating status includes common application and non-common application;
Step S410, the memory source currently occupied according to each application, and what is set respectively apply corresponding resource thresholding, really Surely the memory source occupied is more than the intended application of corresponding resource thresholding, and one of application is corresponded to there are one resource thresholding, Identified intended application includes common intended application and non-common intended application;
Step S420, the cleaning grade respectively applied in non-common intended application is determined;
Step S430, it for the non-common intended application that cleaning grade is the first estate, carries out memory and uses the clear of data Reason;
Step S440, for the non-common intended application that cleaning grade is the second grade, handle using kill;
Wherein, the first estate is higher than the second grade.
Step S450, judge the current free memory resource of electronic equipment, if it is more than the normal thresholding of default resource, if It is to execute step S460, if it is not, executing step S470;
Step S460, it is cleared up without commonly using the memory of intended application;
Step S470, the cleaning grade respectively applied in common intended application is determined;
Step S480, for the common intended application that cleaning grade is the first estate, the cleaning that memory uses data is carried out;
Step S490, for the common intended application that cleaning grade is the second grade, handle using kill.
Optionally, if killed application is common application, the embodiment of the present invention can also restart killed commonly use and answer With if killed application is non-common application, the embodiment of the present invention can restarting without application of being killed.
One of memory method for cleaning provided in an embodiment of the present invention is illustrated using example below:
When clicking the suspended window that electronic equipment is shown in user, or suspended window being moved to presumptive area, electronic equipment touches Send out memory clean-up process;Optionally, when can also be the small set memory resource thresholding of the current free memory resource of electronic equipment, Direct automatic trigger memory clean-up process;Optionally, the embodiment of the present invention can trigger memory when user does not operate electronic equipment Clean-up process is such as in screen state of going out in electronic equipment, and the currently available memory source of electronic equipment is less than set memory resource When thresholding, determines and currently meet memory cleaning condition, automatic trigger memory clean-up process;
Determine that the application in background operation state or non-data download state is A, B, C, D and E, and determine using A, B, the memory source that C, D and E are currently occupied distinguishes a, b, c, d and e, wherein being non-common application using A, B and C, D and E are normal With application;
It determines and is more than itself corresponding resource thresholding a1 using the memory source a that A is currently occupied, currently occupied using B Memory source b is more than itself corresponding resource thresholding b1, is not more than itself corresponding money using the memory source c that C is currently occupied Source thresholding c1 is more than itself corresponding resource thresholding d1, the memory currently occupied using E using the memory source d that D is currently occupied Resource e is more than itself corresponding resource thresholding e1;
It will be determined as the non-common application of target using A and B, and be determined as the common application of target using D and E, exclude to apply C;
Memory cleaning first is carried out to application A and B, is the first estate using the cleaning grade of A, is using the cleaning grade of B Second grade;The cleaning that memory uses data then is carried out to application A, is directly killed using B;
After carrying out memory cleaning to application A and B, if to reach 70% available for the current free memory resource of electronic equipment (the normal thresholding of default resource), then it is unclear to use C and D, terminate memory clean-up process;
After carrying out memory cleaning to application A and B, if the current free memory resource of electronic equipment be not up to 70% can With then to application C and D progress memory cleanings;Cleaning grade using C is the first estate, and the cleaning grade using D is second etc. Grade then carries out the cleaning that memory uses data to application C, is directly killed using D;Again to carrying out weight using D after killing using D It opens.
Optionally, presetting the normal thresholding of resource can be consistent with set memory resource thresholding, also can be inconsistent.
Optionally, each itself corresponding resource thresholding of application can be specified by user, specifically, the present invention is implemented Example can choose the resource use value of application and the selected application of definition when setting each itself corresponding resource thresholding of application, Selected application and defined resource use value are associated, determine that associated resource use value is selected application Corresponding resource thresholding;When resource use value can be application and development, rule of thumb defined by developer, also can by with Family is self-defined.
Optionally, in order to enable the memory that the embodiment of the present invention is carried out clears up more accurate, reasonable, the embodiment of the present invention The adjustment using itself corresponding resource thresholding can be carried out according to the history service condition of application;Specifically, the embodiment of the present invention The corresponding resource thresholding of each application can be adjusted by intelligence learning mode, i.e., thresholding is adjusted according to usage time, time length then carries High threshold, the time is short, reduces thresholding;Corresponding, Fig. 5 shows the corresponding resource thresholding of application provided in an embodiment of the present invention Setting method flow chart, with reference to Fig. 5, this method may include:
Step S500, each history usage time applied in set period of time is determined;
If step S510, history usage time is more than there are the application that history usage time is more than setting first time The resource thresholding for setting the application of first time is set as Secondary resource use value, the second money by current first resource use value Source use value is more than first resource use value;
If step S520, history usage time is less than there are the application that history usage time is less than the second time of setting The resource thresholding for setting the application of the second time is set as the 4th resource use value, the 4th money by current information resources use value Source use value is less than information resources use value, and the second time was less than at the first time.
Optionally, it if the history usage time of application is between the second time and first time, keeps using correspondence Resource thresholding it is constant.
For ease of understanding, an example of method shown in Fig. 5 is as follows:It is at the first time 14 with set period of time for one week Hour, the second time was for 1 hour, was 5% EMS memory occupation ratio in itself corresponding resource thresholding of user-association application A Afterwards, electronic equipment can determine the usage time of application A in one week;If be more than 14 hours using usage times of the A in one week, It then can be improved using the corresponding resource thresholdings of A, such as using A, currently corresponding resource thresholding is 5% EMS memory occupation ratio, then by 5% It is promoted to 6% EMS memory occupation ratio;If be less than 1 hour using usage times of the A in one week, can reduce corresponding using A Resource thresholding such as deposits occupancy ratio by 5% and is reduced to 4% EMS memory occupation ratio;Obviously, the corresponding resource threshold elevations of A are being applied extremely After 6% EMS memory occupation ratio, if being less than 1 hour in the usage time in next week using A, it can reduce using the corresponding resource doors of A Limit, is such as reduced to 5% by 6%;After the corresponding resource thresholdings of application A are reduced to 4% EMS memory occupation ratio, if using A next The usage time in week is more than 14 hours, then can be improved using the corresponding resource thresholdings of A, be such as promoted to 5% by 4% EMS memory occupation ratio EMS memory occupation ratio;If using usage times of the A in one week between 1 hour to 14 hours, keep applying the corresponding moneys of A Source thresholding is constant.In embodiments of the present invention, it can also set using the corresponding resource thresholding lower and upper limit of A, be limited to as follows 3%, the upper limit 7% no longer reduces after then the resource thresholding of A being applied to be reduced to 3% EMS memory occupation ratio, using the resource thresholding of A It is no longer increased after being increased to 7% EMS memory occupation ratio so that adjusted between the upper limit and lower limit using the corresponding resource thresholdings of A.
Memory method for cleaning provided in an embodiment of the present invention carries out the purpose of memory cleaning according to the service condition of application, The waste to the system resource of electronic equipment can be reduced.
Electronic equipment provided in an embodiment of the present invention is introduced below, which can be mounted with realization and retouch above The function module for the memory method for cleaning stated, electronic equipment specific functional modules content described below can with it is above-described interior It deposits method for cleaning and corresponds reference.
Fig. 6 is the structure diagram of electronic equipment provided in an embodiment of the present invention, and with reference to Fig. 6, which may include:
First determining module 100, for when determining that meeting memory clears up condition, determining in each of setting operating status Using the memory source currently occupied;
Respectively applying for second determining module 200, the memory source for currently being occupied according to each application, and setting is corresponding Resource thresholding determines that the memory source occupied is more than the intended application of corresponding resource thresholding, and one of application is corresponding with one A resource thresholding;
Cleaning modul 300, for carrying out memory cleaning to the intended application.
Optionally, intended application may include common intended application and non-common intended application;Fig. 7 shows of the invention real A kind of alternative construction of the cleaning modul 300 of example offer is applied, with reference to Fig. 7, cleaning modul 300 may include:
Unit 310 is cleared up in non-common application, for carrying out memory cleaning to non-common intended application;
Cancel cleaning unit 311, if after for carrying out memory cleaning to non-common intended application, the electronic equipment can Reach the normal thresholding of default resource with memory source, then cancels and memory cleaning is carried out to common intended application;
Common application cleaning unit 312, if after for carrying out memory cleaning to non-common intended application, the electronic equipment The not up to default normal thresholding of resource of free memory resource, then continue to carry out memory cleaning to common intended application.
Optionally, Fig. 8 shows a kind of alternative construction of the first determining module 100 provided in an embodiment of the present invention, reference Fig. 8, the first determining module 100 may include:
Memory source determination unit 110, for determining that the application in background operation state or non-data download state is worked as The memory source of preceding occupancy.
Optionally, Fig. 9 shows another structure diagram of electronic equipment provided in an embodiment of the present invention, in conjunction with 6 and Fig. 9 institutes Show, which can also include:
Cleaning condition determining module 400, for being in go out screen state, and currently available memory source in the electronic equipment When less than set memory resource thresholding, determines and meet memory cleaning condition;Or, detecting that user clicks the electronic equipment When showing the first icon shown by screen, determine that the memory cleaning condition that meets, first icon are to carry out memory cleaning pair The icon answered.
Optionally, Figure 10 shows another alternative construction of cleaning modul 300 provided in an embodiment of the present invention, with reference to figure 10, cleaning modul 300 may include:
Level de-termination unit 320 is cleared up, the cleaning grade for determining the application being cleaned;
First cleaning unit 321 is answered if the cleaning grade of the application for being cleaned is the first estate what is be cleaned With carry out memory use data cleaning;
Second cleaning unit 322 kills if the cleaning grade of the application for being cleaned is the second grade to being cleaned Application, wherein the first estate be higher than the second grade.
Optionally, Figure 11 shows another structure diagram of electronic equipment provided in an embodiment of the present invention, in conjunction with 6 and Figure 11 Shown, which can also include:
Module 500 is restarted, for after killing the application being cleaned, if killed application is common application, restarting Killed common application, if killed application is non-common application, killed non-common application is restarted in cancellation.
Optionally, Figure 12 shows the another structure diagram of electronic equipment provided in an embodiment of the present invention, in conjunction with 6 and Figure 12 Shown, which can also include:
First setting module 600, the resource use value for choosing application and the selected application of definition, will be selected It is associated using with defined resource use value, determines that associated resource use value is the selected corresponding resource of application Thresholding.
Optionally, Figure 13 shows another structure diagram again of electronic equipment provided in an embodiment of the present invention, in conjunction with 6 and figure Shown in 13, which can also include:
Usage time determining module 700, for determining each history usage time applied in set period of time;
If the first adjustment module 800 makes history for there are the application that history usage time is more than setting first time Being set as Secondary resource by current first resource use value more than the resource thresholding of the application of setting first time with the time makes With value, Secondary resource use value is more than first resource use value;
If second adjustment module 900 makes history for there are the application that history usage time is less than the second time of setting Being set as the 4th resource by current information resources use value less than the resource thresholding of the application of the second time of setting with the time makes With value, the 4th resource use value is less than information resources use value, and the second time was less than at the first time.
Electronic equipment provided in an embodiment of the present invention, when carrying out memory cleaning, be choose in setting operating status, and The application that itself can occupy resource thresholding that the memory source currently occupied is more than setting is cleared up, so that common application The memory source currently occupied is more than when itself can occupy resource thresholding of setting, the embodiment of the present invention also will to common application into Row memory is cleared up, and the waste that do not clear up to the system resource of electronic equipment of common application is reduced.The embodiment of the present invention realizes The purpose that memory cleaning is carried out according to the service condition of application, reduces the waste to the system resource of electronic equipment.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with other The difference of embodiment, just to refer each other for identical similar portion between each embodiment.For device disclosed in embodiment For, since it is corresponded to the methods disclosed in the examples, so description is fairly simple, related place is said referring to method part It is bright.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, depends on the specific application and design constraint of technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest range caused.

Claims (10)

1. a kind of memory method for cleaning, which is characterized in that it is applied to electronic equipment, including:
When determining that meeting memory clears up condition, the memory source that each application in setting operating status currently occupies is determined;
According to each apply the memory source that currently occupies, and corresponding resource thresholding is respectively applied in setting, determines the memory occupied Resource is more than the intended application of corresponding resource thresholding, and one of application is corresponding, and there are one resource thresholding, the intended applications Including common intended application or non-common intended application;
Memory cleaning is carried out to the intended application.
2. memory method for cleaning according to claim 1, which is characterized in that the intended application includes common intended application With non-common intended application;It is described to include to intended application progress memory cleaning:
Memory cleaning is carried out to non-common intended application;
If after carrying out memory cleaning to non-common intended application, the free memory resource of the electronic equipment is reaching default resource just Normal thresholding is then cancelled and carries out memory cleaning to common intended application;
If after carrying out memory cleaning to non-common intended application, the not up to default resource of free memory resource of the electronic equipment Normal thresholding then continues to carry out memory cleaning to common intended application.
3. memory method for cleaning according to claim 1, which is characterized in that the determination is in each of setting operating status Include using the memory source currently occupied:
Determine the memory source that the application in background operation state or non-data download state currently occupies.
4. according to claim 1-3 any one of them memory method for cleaning, which is characterized in that respectively apply corresponding resource thresholding Setting process include:
The resource use value for choosing application and the selected application of definition, by selected application and defined resource use value It is associated, determines that associated resource use value is the selected corresponding resource thresholding of application.
5. according to claim 1-3 any one of them memory method for cleaning, which is characterized in that respectively apply corresponding resource thresholding Setting process include:
Determine each history usage time applied in set period of time;
If there are the applications that history usage time is more than setting first time, history usage time is more than setting first time The resource thresholding of application is set as Secondary resource use value by current first resource use value, and Secondary resource use value is more than the One resource use value;
If there are the applications that history usage time is less than the second time of setting, history usage time is less than the second time of setting The resource thresholding of application is set as the 4th resource use value by current information resources use value, and the 4th resource use value is less than the Three resource use values, the second time are less than at the first time.
6. according to claim 1-3 any one of them memory method for cleaning, which is characterized in that the determination meets memory cleaning Condition includes:
It is in and goes out screen state in the electronic equipment, and when currently available memory source is less than set memory resource thresholding, determine Meet memory cleaning condition;
Or, when detecting that user clicks the first icon shown by the display screen of the electronic equipment, determination meets memory Cleaning condition, first icon are to carry out memory to clear up corresponding icon.
7. memory method for cleaning according to claim 1, which is characterized in that described clear to intended application progress memory Reason includes:
Determine the cleaning grade for the application being cleaned;
If the cleaning grade for the application being cleaned is the first estate, memory is carried out to the application being cleaned and uses the clear of data Reason;
If the cleaning grade for the application being cleaned is the second grade, the application to being cleaned is killed, wherein the first estate is higher than Second grade.
8. electronic equipment memory method for cleaning according to claim 7, which is characterized in that further include:
After killing the application being cleaned, if killed application is common application, killed common application is restarted, if by The application of kill is non-common application, then cancels and restart killed non-common application.
9. a kind of electronic equipment, which is characterized in that including:
First determining module, for when determining that meeting memory clears up condition, determining that each application in setting operating status is worked as The memory source of preceding occupancy;
Corresponding resource door is respectively applied in second determining module, the memory source for currently being occupied according to each application, and setting Limit determines that the memory source occupied is more than the intended application of corresponding resource thresholding, and one of application is corresponding, and there are one resources Thresholding, the intended application include common intended application or non-common intended application;
Cleaning modul, for carrying out memory cleaning to the intended application.
10. electronic equipment according to claim 9, which is characterized in that the cleaning modul includes:
Unit is cleared up in non-common application, for carrying out memory cleaning to non-common intended application;
Cancel cleaning unit, if after for carrying out memory cleaning to non-common intended application, the free memory of the electronic equipment Resource reaches the normal thresholding of default resource, then cancels and carry out memory cleaning to common intended application;
Application cleaning unit is commonly used, if after for carrying out memory cleaning to non-common intended application, the electronic equipment can be used The memory source not up to normal thresholding of default resource, then continue to carry out memory cleaning to common intended application.
CN201510037517.2A 2015-01-26 2015-01-26 A kind of memory method for cleaning and electronic equipment Active CN104536907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510037517.2A CN104536907B (en) 2015-01-26 2015-01-26 A kind of memory method for cleaning and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510037517.2A CN104536907B (en) 2015-01-26 2015-01-26 A kind of memory method for cleaning and electronic equipment

Publications (2)

Publication Number Publication Date
CN104536907A CN104536907A (en) 2015-04-22
CN104536907B true CN104536907B (en) 2018-11-09

Family

ID=52852437

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510037517.2A Active CN104536907B (en) 2015-01-26 2015-01-26 A kind of memory method for cleaning and electronic equipment

Country Status (1)

Country Link
CN (1) CN104536907B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866190B (en) * 2015-04-27 2017-02-15 努比亚技术有限公司 Mobile terminal and method for realizing internal storage clearing operation through multi-finger sliding by mobile terminal
CN105824702A (en) * 2016-03-22 2016-08-03 乐视云计算有限公司 Method and terminal for managing program memory footprint
CN105893153A (en) * 2016-03-31 2016-08-24 北京百纳威尔无线通信设备有限公司 Memory cleaning method and device for mobile terminal
CN107291549B (en) * 2016-03-31 2020-11-24 阿里巴巴集团控股有限公司 Method and device for managing application program
CN105975301B (en) * 2016-04-29 2018-09-04 北京小米移动软件有限公司 Memory method for cleaning and device, electronic equipment
CN105898077A (en) * 2016-06-21 2016-08-24 韩文杰 Smartphone capable of automatically cleaning memory
CN106774787A (en) * 2016-11-18 2017-05-31 北京奇虎科技有限公司 A kind of mode control method and electronic equipment
CN107133097B (en) * 2017-04-16 2020-06-16 深圳前海财信云科技有限公司 Memory optimization method and device
CN106980525A (en) * 2017-04-25 2017-07-25 北京奇虎科技有限公司 Using startup method, device and mobile terminal
WO2019047045A1 (en) * 2017-09-06 2019-03-14 深圳传音通讯有限公司 Memory cleaning method and user terminal
CN107665147B (en) * 2017-09-26 2019-12-06 厦门美图移动科技有限公司 System cleaning method of mobile equipment and mobile equipment
CN107766134B (en) * 2017-09-26 2020-01-17 厦门美图移动科技有限公司 System cleaning method of mobile equipment and mobile equipment
CN109117384A (en) * 2018-07-05 2019-01-01 麒麟合盛网络技术股份有限公司 A kind of reminding method and device of memory cleaning
CN112948208B (en) * 2021-02-24 2022-06-21 视若飞信息科技(上海)有限公司 Memory monitoring and recycling method, system, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324575A (en) * 2012-03-23 2013-09-25 腾讯科技(深圳)有限公司 Memory clearing method and mobile terminal
CN104298549A (en) * 2014-09-30 2015-01-21 北京金山安全软件有限公司 Method and device for cleaning application programs in mobile terminal and mobile terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7096339B2 (en) * 2003-03-01 2006-08-22 International Business Machines Corporation System and method for detecting memory management programming errors
CN101859261B (en) * 2010-06-09 2015-05-13 中兴通讯股份有限公司 Control method and control equipment for releasing memory
CN103645955A (en) * 2013-12-16 2014-03-19 百度在线网络技术(北京)有限公司 Running management method and device for application program
CN104077191A (en) * 2014-07-18 2014-10-01 广州金山网络科技有限公司 Method and device used for managing memory resources

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324575A (en) * 2012-03-23 2013-09-25 腾讯科技(深圳)有限公司 Memory clearing method and mobile terminal
CN104298549A (en) * 2014-09-30 2015-01-21 北京金山安全软件有限公司 Method and device for cleaning application programs in mobile terminal and mobile terminal

Also Published As

Publication number Publication date
CN104536907A (en) 2015-04-22

Similar Documents

Publication Publication Date Title
CN104536907B (en) A kind of memory method for cleaning and electronic equipment
Rzadca et al. Autopilot: workload autoscaling at google
CN103164268B (en) System optimization method and device
CN106357811B (en) A kind of delet method of Backup Data, apparatus and system
CN107911487A (en) Information-pushing method, device, server and readable storage medium storing program for executing
CN105471935B (en) Information prompting method and device
CN105094630B (en) The prompt information processing method and device of application program PUSH message
CN104503887A (en) Method and device for showing state of computing equipment
CN109614168A (en) Memory Optimize Method and device
CN101636000A (en) Treating method and treatment device of alarm storms
CN111258921A (en) Method and device for recycling garbage memory, electronic equipment and storage medium
US20200074540A1 (en) Debt resolution planning platform for accelerating charge off
CN106022108A (en) Synchronous management method and terminal device
CN104346279A (en) Method and device for software testing
CN106357774A (en) Information pushing method and network device
CN107092551A (en) A kind of server system performance optimization method and device
CN111507852A (en) Method, device, medium and equipment for determining insurance scheme based on big data
CN115390993A (en) Virtual machine memory processing method and device, electronic equipment and storage medium
CN105847284A (en) Communication service processing method, device and server
CN108829316A (en) Data capture method, device, electronic equipment and readable storage medium storing program for executing
CN113946385A (en) Application program cleaning method and application program cleaning device
CN109117384A (en) A kind of reminding method and device of memory cleaning
CN115963955A (en) Mobile terminal behavior data acquisition method and device
US20210374619A1 (en) Sequential machine learning for data modification
CN113479215A (en) Method, device, equipment and medium for transmitting automatic driving abnormal data

Legal Events

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