CN105893267A - Memory space clearing method and device - Google Patents
Memory space clearing method and device Download PDFInfo
- Publication number
- CN105893267A CN105893267A CN201510660470.5A CN201510660470A CN105893267A CN 105893267 A CN105893267 A CN 105893267A CN 201510660470 A CN201510660470 A CN 201510660470A CN 105893267 A CN105893267 A CN 105893267A
- Authority
- CN
- China
- Prior art keywords
- memory
- mark
- shared
- memory headroom
- processes
- 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.)
- Pending
Links
Abstract
Embodiments of the invention provide a memory space clearing method and device. The method comprises the following steps: obtaining a progress which occupies the maximum memory in all the running progresses in an operation system and recording a memory space size occupied by the progress; comparing recorded the memory space size occupied by the progress with an available memory space size, and when the comparison result is that the memory space size occupied by the progress is greater than the available memory space size, stopping part of or all the progresses according to a preset rule. According to the method and device provided by the invention, a triggering condition for memory clearing is set and memory clearing is carried out when the triggering condition is satisfied, so that the problem of excessive memory occupation caused by not clearing the memory space for a long time is avoided, the running of application programs in terminal is more smooth and the system performance is improved; moreover, a memory space clearing threshold value is dynamically set, so that the currently running progresses are not jammed and then the user experience is effectively improved.
Description
Technical field
The present embodiments relate to communication equipment application, particularly relate to a kind of memory headroom method for cleaning and
Device.
Background technology
In the terminal, when application program runs, the internal memory dynamic space application statement in application program can be to
Operating system application is for storing the space of data, and now, operating system opens up a dynamic sky from internal memory
Between and distribute to this application program;When, after application program end of run, operating system is released to this application program
The dynamic space opened up, in order to other programs are continuing with the dynamic space in this internal memory when running.
And in Android (Android) operating system, memory management scheme is when application program returns
Wait, do not discharge the apllied dynamic space of this application program;Now, memory headroom will be caused more and more less,
System running speed reduces.When available memory space size is reduced to a certain degree, operating system can be made to transport
Row slowly, until occurring that operating system cannot distribute dynamic space, causes whole operating system to be paralysed
Situation.
As can be seen here, in current Android operation system, there is the problem that EMS memory occupation amount is excessive.
Summary of the invention
The embodiment of the present invention provides a kind of memory headroom method for cleaning and device, in order to solve the operation of current Android
In system, there is the problem that EMS memory occupation amount is excessive.
The concrete technical scheme that the embodiment of the present invention provides is as follows:
The embodiment of the present invention provides a kind of memory headroom method for cleaning, is applied in Android operation system, including:
In all processes being currently running from described operating system, obtain shared by the process that committed memory is maximum
Use memory headroom size;
Obtain current time available memory space size;
If memory headroom size shared by described process is more than described available memory space size, then according to presetting
Rule, closes the current part run or all processes.
The embodiment of the present invention provides a kind of memory headroom cleaning plant, is applied in Android system, including:
Process committed memory space size acquiring unit, all for be currently running from described operating system
In process, obtain memory headroom size shared by the process that committed memory is maximum;
Available memory space size acquisition unit, is used for obtaining current time available memory space size;
Process closing unit, if empty more than described free memory for memory headroom size shared by described process
Between size, then according to preset rules, close the current part run or all processes.
The embodiment of the present invention provides a kind of memory headroom method for cleaning and device, by just obtaining in operating system
In all processes run, the process that committed memory is maximum, and it is big to record memory headroom shared by this process
Little;Memory headroom size shared by the described process of record and available memory space size are compared, when
When comparative result is memory headroom size shared by described process more than described available memory space size, according to
Preset rules, closes the current part run or all processes.Use technical solution of the present invention, set clear
The trigger condition of reason internal memory, when trigger condition meets, i.e. clears up internal memory, thus it is long to avoid memory headroom
Time does not clear up the problem that caused EMS memory occupation is excessive, makes the operation of application program in terminal more flow
Freely, improve systematic function;Further, in all processes that dynamically acquisition current time is currently running take
Deposit the process that space is maximum, and using the memory headroom shared by the process of this acquisition as judging whether that cleaning is interior
Deposit the threshold value in space, thus ensure that the process being currently running does not haves the problem of card, effectively carry
High Consumer's Experience.
Accompanying drawing explanation
Fig. 1 is memory headroom clean-up process figure in the embodiment of the present invention one;
Fig. 2 is memory headroom clean-up process figure in the embodiment of the present invention two;
Fig. 3 is memory headroom cleaning plant structural representation in the embodiment of the present invention.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with the present invention
Accompanying drawing in embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention, it is clear that
Described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based in the present invention
Embodiment, those of ordinary skill in the art obtained under not making creative work premise all its
His embodiment, broadly falls into the scope of protection of the invention.
Below in conjunction with Figure of description, the embodiment of the present invention is described in further detail.
There is startup first and start first with non-in terminal, in the embodiment of the present invention, for starting first and non-head
The secondary method difference starting cleaning internal memory, below in conjunction with concrete application scenarios, describes terminal cleaning internal memory in detail
Process.Optionally, described terminal is mobile phone, intelligent television, computer etc..
Embodiment one
Refering to shown in Fig. 1, in the embodiment of the present invention, when terminal starts first, carry out memory headroom cleaning
Process, including:
Step 100: in all processes being currently running from described operating system, obtains committed memory maximum
Process shared by memory headroom size.
In the embodiment of the present invention, terminal operating specifies designator, obtains and is currently running in described operating system
All processes, and memory headroom size shared by each process being currently running;And it is all from obtain
Shared memory headroom size chooses maximum.Wherein, described appointment designator is
ActivityManager.getProcessMemoryInfo。
Optionally, terminal can receive the memory headroom cleaning instruction of other equipment or user's transmission, when connecing
When receiving memory headroom cleaning instruction, run and specify designator, the institute being currently running from described operating system
Have in process, obtain memory headroom size shared by the process that committed memory is maximum.Wherein, described terminal can
Think the electronic product comprising human-computer interaction interface, user can by the human-computer interaction interface of this terminal,
Terminal inputs memory headroom cleaning instruction;Optionally, described terminal comprises memory headroom cleaning application journey
Sequence, when terminal detects that user triggers memory headroom cleaning application program, i.e. starts described memory headroom clear
Reason application program, and perform memory headroom cleaning operation by described memory headroom liquidation procedures.
Optionally, terminal can preset memory headroom cleaning cycle in this locality, i.e. clears up when current memory space
When cycle arrives, run and specify designator, in all processes being currently running from described operating system, obtain
Take memory headroom size shared by the process that committed memory is maximum;Wherein, described default memory headroom cleaning week
Phase can be arranged according to concrete application scenarios.Such as, memory headroom cleaning cycle is set to 3 seconds, from eventually
The time point that end starts starts, and terminal starts local timer and starts timing, when timer grows to constantly
When reaching 3 seconds, terminal performs memory headroom cleaning operation, and meanwhile, described timer resets, and again
Start timing.Use technique scheme, preset memory headroom cleaning cycle in terminal, without manual intervention,
Relatively reliable cleaning internal memory, it is to avoid when system running speed is slack-off, that user just starts memory headroom is clear
During reason process, the problem that in the operating system caused, application program execution efficiency is low, it is effectively increased systematicness
Energy.
Step 110: obtain current time available memory space size.
In the embodiment of the present invention, terminal obtains current time available memory space size.Optionally, terminal can
With input corresponding to the order of available memory space acquiring size, obtain described current time available memory space
Size, as used ActivityManager.MemoryInfo order, obtains described current time free memory
Space size;Additionally, terminal can also obtain by running available memory space acquiring size application program
Described current time available memory space size.
Step 120: if memory headroom size shared by described process is more than described available memory space size,
Then according to preset rules, close the current part run or all processes.
In the embodiment of the present invention, terminal is by big with available memory space for memory headroom size shared by described process
Little compare;If it is empty more than described free memory that comparative result is memory headroom size shared by described process
Between size, then according to preset rules, close the current part run or all processes;Otherwise, terminal is not
Perform memory headroom cleaning operation.
Optionally, terminal can close the part of current operation or all processes to use following three kinds of modes:
First kind of way: preset white list in this locality, comprises the mark of the process not being moved to end in this white list;
Obtain the mark of all processes being currently running;And for obtain all processes mark in any
The mark of one process, if it is determined that there is not the mark of described any one process in the white list preset, then closes
The process of the mark correspondence of described any one process.
Optionally, terminal can be serviced by the activitymanager of described operating system
GetRunningApp interface, obtains the mark of all processes being currently running.
Optionally, described terminal can be serviced by the activitymanager of described operating system
KillBackGround interface, closes the process that the mark of described any one process is corresponding.
Owing to, during terminal operating, Partial Process is the process that terminal operating operating system is necessary, therefore,
Using technique scheme, terminal can reach to clear up internal memory on the basis ensureing that operating system is properly functioning
Purpose.
The second way, terminal local can comprise human-computer interaction interface;It is all that terminal acquisition is currently running
After the mark of process, the mark of all processes obtained is presented on interpersonal interactive interface;User is permissible
In the mark of all processes presented from described human-computer interaction interface, choose the mark of the process needing cleaning
Know;Terminal detects when process corresponding to the mark of process is chosen in the cleaning of user's input validation, i.e. thinks reception
To process cleaning instruction;Terminal obtains the mark of at least one process comprised in the cleaning instruction of described process;
Close the process that the mark of the process obtained is corresponding.
Optionally, terminal can be serviced by the activitymanager of described operating system
GetRunningApp interface, obtains the mark of all processes being currently running.
Optionally, described terminal can be serviced by the activitymanager of described operating system
KillBackGround interface, closes the process that the mark of described any one process is corresponding.
Using technique scheme, terminal can determine the process needing cleaning according to the instruction of user, make
Terminal can close the unwanted process of user, thus while ensureing that internal memory is cleaned, improves terminal
Operability, reach improve Consumer's Experience purpose.
Further, terminal can also receive the process cleaning instruction that other equipment sends;Such as, terminal is worked as
Time intelligent television time, user can be chosen by the remote control equipment supporting with terminal needs the mark of process of cleaning
Know, and send process cleaning instruction by this remote control equipment to terminal.
The third mode, terminal local can comprise human-computer interaction interface;It is all that terminal acquisition is currently running
After the mark of application program, the mark of all application programs obtained is presented on interpersonal interactive interface;
In the mark of all application programs that user can present from described human-computer interaction interface, choose and need cleaning
The mark of application program;Terminal detects that the mark correspondence of application program is chosen in the cleaning of user's input validation
During process, i.e. think when receive process cleaning instruction time, obtain described process cleaning instruction in comprise to
The mark of a few application program;Wherein, at least one application program described is the application program being currently running;
Obtain the application program of mark correspondence of described application program operationally, the mark of all processes of committed memory
Know;Close the process that the mark of all processes obtained is corresponding.
Optionally, terminal can be serviced by the activitymanager of described operating system
GetRunningApp interface, obtains the mark of all processes being currently running.
Optionally, described terminal can be serviced by the activitymanager of described operating system
KillBackGround interface, closes the process that the mark of described any one process is corresponding.
Using technique scheme, terminal can determine, according to the instruction of user, the application program needing cleaning,
Enable the terminals to close produced all processes when the unwanted application program of user runs, thus ensureing
While internal memory is cleaned, improve the operability of terminal, reach to improve the purpose of Consumer's Experience.
Further, terminal can also receive the process cleaning instruction that other equipment sends;Such as, terminal is worked as
Time intelligent television time, user can by the remote control equipment supporting with terminal choose need cleaning application program
Mark, and by this remote control equipment to terminal send process cleaning instruction.
Further, before closing, record is in this start-up course, and committed memory space is maximum for terminal
Preset number process, and record each process shared by memory headroom size, and by record entering
Journey is defined as historical progress.
In the embodiment of the present invention, in all processes being currently running in terminal, committed memory space maximum
The threshold value that memory headroom size shared by process is cleared up as a memory headroom, when available memory space size
During less than or equal to described threshold value, i.e. clear up internal memory;Compared to setting fixed threshold, work as available memory space
When size is less than or equal to this fixed threshold, the method i.e. clearing up internal memory, use technique scheme, dynamically
Change the threshold value for clearing up internal memory, as long as currently available memory headroom size meets dynamic threshold, even if working as
Front available memory space size is less, it is also possible to available memory space size the most just always ensure that
The process smoothness maximum in the committed memory space run is run, and need not frequently call memory headroom and clear up
Journey, alleviates the load of system, improves systematic function.
Embodiment two
Refering to shown in Fig. 2, in the embodiment of the present invention, terminal is non-when starting first, carries out memory headroom cleaning
Process, including:
Step 200: when terminal starts, obtains in the historical progress stored in described terminal, takies storage
Memory headroom size shared by the historical progress that space is maximum.
In the embodiment of the present invention, owing to, in terminal each time start-up course, being required to record this and starting
Cheng Zhong, the process that committed memory space size is maximum, therefore, terminal is when this starts, directly from this locality
Read in starting last time, the historical progress (hereinafter referred to as maximum historical progress) that committed memory space size is maximum
, and obtain storage size shared by described maximum historical progress.
Further, in obtaining described terminal in the historical progress of storage, take maximum the going through of memory space
After memory headroom size shared by history process, terminal detects whether this locality comprises described maximum historical progress pair
The application program answered, if comprising, then performs step 210;Otherwise, terminal will determine that described maximum history is entered
Application program corresponding to journey is the most unloaded, and now, terminal will reject described maximum from described historical progress
Historical progress, and from remaining historical progress, selects the maximum historical progress in committed memory space as
Big historical progress, and obtain memory headroom size shared by described maximum historical progress.
Use technique scheme, when terminal starts, i.e. obtain maximum historical progress, and judge this maximum
Whether application program corresponding to historical progress be local application program, it is to avoid this locality is the most non-existent
The dynamic threshold caused when the process produced when application program runs is as maximum historical progress arranges unreasonable,
Cause the problem that subsequent memory clears up the system burden weight the most frequently caused.
Step 210: in all processes being currently running from described operating system, obtains committed memory maximum
Process shared by memory headroom size.
In the embodiment of the present invention, terminal operating specifies designator, obtains and is currently running in described operating system
All processes, and memory headroom size shared by each process being currently running;And it is all from obtain
Shared memory headroom size chooses maximum.Wherein, described appointment designator is
ActivityManager.getProcessMemoryInfo。
Optionally, terminal can receive the memory headroom cleaning instruction of other equipment or user's transmission, when connecing
When receiving memory headroom cleaning instruction, run and specify designator, the institute being currently running from described operating system
Have in process, obtain memory headroom size shared by the process that committed memory is maximum.Wherein, described terminal can
Think the electronic product comprising human-computer interaction interface, user can by the human-computer interaction interface of this terminal,
Terminal inputs memory headroom cleaning instruction;Optionally, described terminal comprises memory headroom cleaning application journey
Sequence, when terminal detects that user triggers memory headroom cleaning application program, i.e. starts described memory headroom clear
Reason application program, and perform memory headroom cleaning operation by described memory headroom liquidation procedures.
Optionally, terminal can preset memory headroom cleaning cycle in this locality, i.e. clears up when current memory space
When cycle arrives, run and specify designator, in all processes being currently running from described operating system, obtain
Take memory headroom size shared by the process that committed memory is maximum;Wherein, described default memory headroom cleaning week
Phase can be arranged according to concrete application scenarios.Such as, memory headroom cleaning cycle is set to 3 seconds, from eventually
The time point that end starts starts, and terminal starts local timer and starts timing, when timer grows to constantly
When reaching 3 seconds, terminal performs memory headroom cleaning operation, and meanwhile, described timer resets, and again
Start timing.Use technique scheme, preset memory headroom cleaning cycle in terminal, without manual intervention,
Relatively reliable cleaning internal memory, it is to avoid when system running speed is slack-off, that user just starts memory headroom is clear
During reason process, the problem that in the operating system caused, application program execution efficiency is low, it is effectively increased systematicness
Energy.
Step 220: if described maximum historical progress committed memory space size is less than the described process institute obtained
Committed memory space size, then be sized to Dram by memory headroom shared by the process of described acquisition
Space cleaning threshold;Otherwise, described maximum historical progress committed memory space size is defined as Dram
Space cleaning threshold.
In the embodiment of the present invention, described in memory headroom size shared by described maximum historical progress and acquisition
Shared by process, memory headroom size compares;When comparative result is described maximum historical progress committed memory
When space size is less than memory headroom size shared by the described process obtained, shared by the process of described acquisition
It is sized to Dram space cleaning threshold with memory headroom;When comparative result is that described maximum history is entered
Journey committed memory space size more than or equal to obtain described process shared by memory headroom size time, by institute
State maximum historical progress committed memory space size and be defined as Dram space cleaning threshold.
Using technique scheme, after terminal starts, memory headroom shared by the process being currently running is less than
During described maximum historical progress committed memory space size, will internal memory shared by described maximum historical progress empty
Between be sized to Dram space cleaning threshold, thus avoid and be triggered in follow-up maximum historical progress
Time, the memory headroom caused is not enough, causes the problem that system running speed is slow, it is ensured that in system, each enters
The smooth operation of journey, improves systematic function.
Step 230: obtain current time available memory space size.
In the embodiment of the present invention, terminal obtains current time available memory space size.Optionally, terminal can
With input corresponding to the order of available memory space acquiring size, obtain described current time available memory space
Size, as used ActivityManager.MemoryInfo order, obtains described current time free memory empty
Between size;Additionally, terminal can also obtain institute by running available memory space acquiring size application program
State current time available memory space size.
Step 240: judge that described dynamic threshold, whether more than described available memory space size, is if so, held
Row step 250;Otherwise, step 260 is performed.
Step 250: according to preset rules, close the current part run or all processes.
In the embodiment of the present invention, described dynamic threshold is compared by terminal with available memory space size;If
Comparative result is that described dynamic threshold is more than described available memory space size, then according to preset rules, close
The current part run or all processes.
Optionally, terminal can close the part of current operation or all processes to use following three kinds of modes:
First kind of way: preset white list in this locality, comprises the mark of the process not being moved to end in this white list;
Obtain the mark of all processes being currently running;And for obtain all processes mark in any
The mark of one process, if it is determined that there is not the mark of described any one process in the white list preset, then closes
The process of the mark correspondence of described any one process.
Optionally, terminal can be serviced by the activitymanager of described operating system
GetRunningApp interface, obtains the mark of all processes being currently running.
Optionally, described terminal can be serviced by the activitymanager of described operating system
KillBackGround interface, closes the process that the mark of described any one process is corresponding.
Owing to, during terminal operating, Partial Process is the process that terminal operating operating system is necessary, therefore,
Using technique scheme, terminal can reach to clear up internal memory on the basis ensureing that operating system is properly functioning
Purpose.
The second way, terminal local can comprise human-computer interaction interface;It is all that terminal acquisition is currently running
After the mark of process, the mark of all processes obtained is presented on interpersonal interactive interface;User is permissible
In the mark of all processes presented from described human-computer interaction interface, choose the mark of the process needing cleaning
Know;Terminal detects when process corresponding to the mark of process is chosen in the cleaning of user's input validation, i.e. thinks reception
To process cleaning instruction;Terminal obtains the mark of at least one process comprised in the cleaning instruction of described process;
Close the process that the mark of the described process obtained is corresponding.
Optionally, terminal can be serviced by the activitymanager of described operating system
GetRunningApp interface, obtains the mark of all processes being currently running.
Optionally, described terminal can be serviced by the activitymanager of described operating system
KillBackGround interface, closes the process that the mark of described any one process is corresponding.
Using technique scheme, terminal can determine the process needing cleaning according to the instruction of user, make
Terminal can close the unwanted process of user, thus while ensureing that internal memory is cleaned, improves terminal
Operability, reach improve Consumer's Experience purpose.
Further, terminal can also receive the process cleaning instruction that other equipment sends.
The third mode, terminal local can comprise human-computer interaction interface;It is all that terminal acquisition is currently running
After the mark of application program, the mark of all application programs obtained is presented on interpersonal interactive interface;
In the mark of all application programs that user can present from described human-computer interaction interface, choose and need cleaning
The mark of application program;Terminal detects that the mark correspondence of application program is chosen in the cleaning of user's input validation
During process, i.e. think when receive process cleaning instruction time, obtain described process cleaning instruction in comprise to
The mark of a few application program;Wherein, at least one application program described is the application program being currently running;
Obtain the application program of mark correspondence of described application program operationally, the mark of all processes of committed memory
Know;Close the process that the mark of all processes obtained is corresponding.
Optionally, terminal can be serviced by the activitymanager of described operating system
GetRunningApp interface, obtains the mark of all processes being currently running.
Optionally, described terminal can be serviced by the activitymanager of described operating system
KillBackGround interface, closes the process that the mark of described any one process is corresponding.
Using technique scheme, terminal can determine, according to the instruction of user, the application program needing cleaning,
Enable the terminals to close produced all processes when the unwanted application program of user runs, thus ensureing
While internal memory is cleaned, improve the operability of terminal, reach to improve the purpose of Consumer's Experience.
Further, terminal can also receive the process cleaning instruction that other equipment sends.
Step 260: terminal does not perform memory headroom cleaning operation.
In the embodiment of the present invention, before closing, record is in this start-up course, and committed memory is empty for terminal
Between maximum preset number process, and memory headroom size shared by each process of record, and remembering
The process of record is defined as historical progress.
Compared to setting fixed threshold, when available memory space size is less than or equal to this fixed threshold, i.e.
The method of cleaning internal memory, uses technique scheme, dynamically changes the Dram space for clearing up internal memory
Cleaning threshold, as long as currently available memory headroom size meets Dram space cleaning threshold, even if currently
Available memory space size is less, it is also possible to available memory space size always ensure that the most
The process smoothness operation that the committed memory space run is maximum, need not frequently call memory headroom scale removal process,
Alleviate the load of system, improve systematic function.
Embodiment three
Based on technique scheme, refering to shown in Fig. 3, in the embodiment of the present invention, it is provided that a kind of memory headroom
Cleaning plant, is applied in Android system, including process committed memory space size acquiring unit 30, available
Memory headroom size acquisition unit 31, and process closing unit 32, wherein:
Process committed memory space size acquiring unit 30, for the institute being currently running from described operating system
Have in process, obtain memory headroom size shared by the process that committed memory is maximum;
Available memory space size acquisition unit 31, is used for obtaining current time available memory space size;
Process closing unit 32, if for memory headroom size shared by described process more than described free memory
Space size, then according to preset rules, close the current part run or all processes.
Optionally, described process committed memory space size acquiring unit 30, specifically for: if current memory
Space cleaning cycle arrives, then run and specify designator, be currently running from described operating system all enter
Cheng Zhong, obtains memory headroom size shared by the process that committed memory is maximum;Or, if it is empty to receive internal memory
Between cleaning instruction, then run specify designator, in all processes being currently running from described operating system,
Obtain memory headroom size shared by the process that committed memory is maximum.
Further, described device also includes processing unit 33, is used for: sentences and obtains maximum the entering of committed memory
Before memory headroom size shared by journey, whether disconnected described operating system is to start first;When judging described behaviour
As system be non-start first time, obtain the last time of maximum going through of committed memory in the process of all operations when starting
Memory headroom shared by history process;Obtain memory headroom size shared by the process that committed memory is maximum it
After, described method includes: in shared by memory headroom size shared by described process and described historical progress
Deposit space size to compare;When comparative result is to go through described in memory headroom size shared by described process is less than
Shared by history process during memory headroom size, memory headroom size shared by described process is updated to described in go through
Memory headroom size shared by history process.
Further, described method also includes determining unit 34, is used for: obtain all operations when starting last time
Process in before the maximum memory headroom shared by historical progress of committed memory, determine described historical progress
Corresponding application program is present in this locality.
Optionally, described process closing unit 32, specifically for: obtain all processes being currently running
Mark;And for the mark of any one process in the mark of all processes obtained, if it is determined that preset
White list does not exist the mark of described any one process, then closes the mark correspondence of described any one process
Process;Or, when receiving process cleaning instruction, obtain in the cleaning instruction of described process and comprise at least
The mark of one process;Close the process that the mark of the described process obtained is corresponding;Or, when receive into
During Cheng Qingli instruction, obtain the mark of at least one application program comprised in the cleaning instruction of described process;Its
In, at least one application program described is the application program being currently running;Obtain the mark of described application program
Corresponding application program operationally, the mark of all processes of committed memory;Close all processes obtained
Process corresponding to mark.
In sum, when terminal is for starting first, all processes being currently running from described operating system
In, obtain memory headroom size shared by the process that committed memory is maximum, obtain current time free memory empty
Between size, if memory headroom size shared by described process is more than described available memory space size, then according to
Preset rules, closes the current part run or all processes;When terminal be non-start first time, at end
When end starts, obtain in the historical progress stored in described terminal, take the historical progress that memory space is maximum
Shared memory headroom size, in all processes being currently running, obtains in taking from described operating system
Deposit memory headroom size shared by the process of maximum, if described maximum historical progress committed memory space size is little
In memory headroom size shared by the described process obtained, then by memory headroom shared by the process of described acquisition
It is sized to Dram space cleaning threshold;Otherwise, by described maximum historical progress committed memory space
It is sized to Dram space cleaning threshold, obtains current time available memory space size, it is judged that institute
When stating dynamic threshold more than described available memory space size, according to preset rules, close the current portion run
Divide or all processes.Use technical solution of the present invention, set the trigger condition of cleaning internal memory, when triggering bar
When part meets, i.e. clear up internal memory, thus avoid memory headroom and the most do not clear up caused EMS memory occupation
Excessive problem, makes the operation of application program in terminal more smooth, improves systematic function;Further, dynamic
State obtains the process that in all processes that current time is currently running, committed memory space is maximum, and by this acquisition
The memory headroom shared by process as judging whether to clear up the threshold value of memory headroom, thus ensure that current
The process being currently running does not haves the problem of card, is effectively increased Consumer's Experience.
Device embodiment described above is only schematically, wherein said illustrates as separating component
Unit can be or may not be physically separate, the parts shown as unit can be or
Person may not be physical location, i.e. may be located at a place, or can also be distributed to multiple network
On unit.Some or all of module therein can be selected according to the actual needs to realize the present embodiment
The purpose of scheme.Those of ordinary skill in the art are not in the case of paying performing creative labour, the most permissible
Understand and implement.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive each reality
The mode of executing can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly
Part.Based on such understanding, the portion that prior art is contributed by technique scheme the most in other words
Dividing and can embody with the form of software product, this computer software product can be stored in computer can
Read in storage medium, such as ROM/RAM, magnetic disc, CD etc., including some instructions with so that one
Computer equipment (can be personal computer, server, or the network equipment etc.) performs each embodiment
Or the method described in some part of embodiment.
Last it is noted that above example is only in order to illustrate the technical scheme of the embodiment of the present invention, rather than
It is limited;Although the embodiment of the present invention being described in detail with reference to previous embodiment, this area
Those of ordinary skill is it is understood that the technical scheme described in foregoing embodiments still can be repaiied by it
Change, or wherein portion of techniques feature is carried out equivalent;And these amendments or replacement, do not make phase
The essence answering technical scheme departs from the spirit and scope of the embodiment of the present invention each embodiment technical scheme.
Claims (10)
1. a memory headroom method for cleaning, is applied in Android operation system, it is characterised in that including:
In all processes being currently running from described operating system, obtain shared by the process that committed memory is maximum
Use memory headroom size;
Obtain current time available memory space size;
If memory headroom size shared by described process is more than described available memory space size, then according to presetting
Rule, closes the current part run or all processes.
Method the most according to claim 1, it is characterised in that transport from described operating system
In all processes of row, obtain memory headroom size shared by the process that committed memory is maximum, specifically include:
If current memory space cleaning cycle arrives, then run and specify designator, from described operating system just
In all processes run, obtain memory headroom size shared by the process that committed memory is maximum;Or,
If receiving memory headroom cleaning instruction, then run and specify designator, from described operating system
In all processes run, obtain memory headroom size shared by the process that committed memory is maximum.
Method the most according to claim 1, it is characterised in that obtain the process that committed memory is maximum
Before shared memory headroom size, described method also includes:
Judge whether described operating system is to start first;
When judge described operating system as non-start first time, obtain last time when starting in the process of all operations
The memory headroom shared by historical progress that committed memory is maximum;
After obtaining memory headroom size shared by the process that committed memory is maximum, described method includes:
Memory headroom size shared by memory headroom size shared by described process and described historical progress is entered
Row compares;
In shared by memory headroom size shared by comparative result is described process is less than described historical progress
When depositing space size, memory headroom size shared by described process is updated in shared by described historical progress
Deposit space size.
Method the most according to claim 1, it is characterised in that obtain all operations when starting last time
Process in before the maximum memory headroom shared by historical progress of committed memory, described method also includes:
Determine that the application program corresponding to described historical progress is present in this locality.
5. according to the method described in any one of claim 1-4, it is characterised in that according to preset rules,
Close the current part run or all processes, specifically include:
Obtain the mark of all processes being currently running;And
For the mark of any one process in the mark of all processes obtained, if it is determined that the white list preset
In there is not the mark of described any one process, then close the process that the mark of described any one process is corresponding;
Or,
When receiving process cleaning instruction, obtain at least one process comprised in the cleaning instruction of described process
Mark;Close the process that the mark of the described process obtained is corresponding;Or,
When receiving process cleaning instruction, obtain at least one application comprised in the cleaning instruction of described process
The mark of program;Wherein, at least one application program described is the application program being currently running;Obtain described
Application program corresponding to the mark of application program operationally, the mark of all processes of committed memory;Close
The process of the mark correspondence of all processes obtained.
6. a memory headroom cleaning plant, is applied in Android operation system, it is characterised in that including:
Process committed memory space size acquiring unit, all for be currently running from described operating system
In process, obtain memory headroom size shared by the process that committed memory is maximum;
Available memory space size acquisition unit, is used for obtaining current time available memory space size;
Process closing unit, if empty more than described free memory for memory headroom size shared by described process
Between size, then according to preset rules, close the current part run or all processes.
Device the most according to claim 6, it is characterised in that described process committed memory space is big
Little acquiring unit, specifically for:
If current memory space cleaning cycle arrives, then run and specify designator, from described operating system just
In all processes run, obtain memory headroom size shared by the process that committed memory is maximum;Or,
If receiving memory headroom cleaning instruction, then run and specify designator, from described operating system
In all processes run, obtain memory headroom size shared by the process that committed memory is maximum.
Device the most according to claim 6, it is characterised in that described device also includes processing unit,
For:
Sentencing before obtaining memory headroom size shared by the process that committed memory is maximum, disconnected described operating system is
No for start first;
When judge described operating system as non-start first time, obtain last time when starting in the process of all operations
The memory headroom shared by historical progress that committed memory is maximum;
After obtaining memory headroom size shared by the process that committed memory is maximum, described method includes:
Memory headroom size shared by memory headroom size shared by described process and described historical progress is entered
Row compares;
In shared by memory headroom size shared by comparative result is described process is less than described historical progress
When depositing space size, memory headroom size shared by described process is updated in shared by described historical progress
Deposit space size.
Device the most according to claim 6, it is characterised in that described method also includes determining unit,
For:
Obtain shared by the historical progress that last time, in the process of all operations, committed memory was maximum when starting is interior
Before depositing space, determine that the application program corresponding to described historical progress is present in this locality.
10. according to the device described in any one of claim 6-9, it is characterised in that described process is closed single
Unit, specifically for:
Obtain the mark of all processes being currently running;And
For the mark of any one process in the mark of all processes obtained, if it is determined that the white list preset
In there is not the mark of described any one process, then close the process that the mark of described any one process is corresponding;
Or,
When receiving process cleaning instruction, obtain at least one process comprised in the cleaning instruction of described process
Mark;Close the process that the mark of the described process obtained is corresponding;Or,
When receiving process cleaning instruction, obtain at least one application comprised in the cleaning instruction of described process
The mark of program;Wherein, at least one application program described is the application program being currently running;Obtain described
Application program corresponding to the mark of application program operationally, the mark of all processes of committed memory;Close
The process of the mark correspondence of all processes obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510660470.5A CN105893267A (en) | 2015-10-14 | 2015-10-14 | Memory space clearing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510660470.5A CN105893267A (en) | 2015-10-14 | 2015-10-14 | Memory space clearing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105893267A true CN105893267A (en) | 2016-08-24 |
Family
ID=57002755
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510660470.5A Pending CN105893267A (en) | 2015-10-14 | 2015-10-14 | Memory space clearing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105893267A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106371904A (en) * | 2016-08-29 | 2017-02-01 | 宇龙计算机通信科技(深圳)有限公司 | Application process clearing method and mobile terminal |
CN107678698A (en) * | 2017-10-31 | 2018-02-09 | 努比亚技术有限公司 | Data cached method for cleaning, server, terminal and computer-readable recording medium |
CN109274991A (en) * | 2018-09-07 | 2019-01-25 | 苏宁智能终端有限公司 | The EMS memory management process and system of smart television |
CN110888740A (en) * | 2019-11-22 | 2020-03-17 | 腾讯科技(深圳)有限公司 | Incremental memory determining method, device and equipment of small program and storage medium |
CN113190369A (en) * | 2021-04-21 | 2021-07-30 | 北京海博思创科技股份有限公司 | Data processing method, device, equipment and storage medium |
CN113961427A (en) * | 2021-12-20 | 2022-01-21 | 荣耀终端有限公司 | System memory analysis method and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984580A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Internal storage cleaning method and system |
CN102984582A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Intelligent television system management method and device carrying operating system |
CN103530235A (en) * | 2013-10-18 | 2014-01-22 | 北京奇虎科技有限公司 | Method and device for clearing internal storage in mobile terminal |
CN104461746A (en) * | 2014-12-30 | 2015-03-25 | 中科创达软件股份有限公司 | Memory space optimization method and system based on Android system |
CN104484282A (en) * | 2014-12-31 | 2015-04-01 | 广东欧珀移动通信有限公司 | Internal storage recovery method and device |
-
2015
- 2015-10-14 CN CN201510660470.5A patent/CN105893267A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984580A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Internal storage cleaning method and system |
CN102984582A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Intelligent television system management method and device carrying operating system |
CN103530235A (en) * | 2013-10-18 | 2014-01-22 | 北京奇虎科技有限公司 | Method and device for clearing internal storage in mobile terminal |
CN104461746A (en) * | 2014-12-30 | 2015-03-25 | 中科创达软件股份有限公司 | Memory space optimization method and system based on Android system |
CN104484282A (en) * | 2014-12-31 | 2015-04-01 | 广东欧珀移动通信有限公司 | Internal storage recovery method and device |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106371904A (en) * | 2016-08-29 | 2017-02-01 | 宇龙计算机通信科技(深圳)有限公司 | Application process clearing method and mobile terminal |
CN107678698A (en) * | 2017-10-31 | 2018-02-09 | 努比亚技术有限公司 | Data cached method for cleaning, server, terminal and computer-readable recording medium |
CN107678698B (en) * | 2017-10-31 | 2020-11-17 | 太仓市昊博技术服务有限公司 | Cache data cleaning method, server, terminal and computer readable storage medium |
CN109274991A (en) * | 2018-09-07 | 2019-01-25 | 苏宁智能终端有限公司 | The EMS memory management process and system of smart television |
CN109274991B (en) * | 2018-09-07 | 2020-11-10 | 苏宁智能终端有限公司 | Memory management method and system of smart television |
CN110888740A (en) * | 2019-11-22 | 2020-03-17 | 腾讯科技(深圳)有限公司 | Incremental memory determining method, device and equipment of small program and storage medium |
CN110888740B (en) * | 2019-11-22 | 2022-06-03 | 腾讯科技(深圳)有限公司 | Incremental memory determining method, device and equipment of small program and storage medium |
CN113190369A (en) * | 2021-04-21 | 2021-07-30 | 北京海博思创科技股份有限公司 | Data processing method, device, equipment and storage medium |
CN113961427A (en) * | 2021-12-20 | 2022-01-21 | 荣耀终端有限公司 | System memory analysis method and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105893267A (en) | Memory space clearing method and device | |
DE60304923T2 (en) | Temporal task distribution in a mobile communication device | |
CN100363898C (en) | Information processor capable of using past processing space | |
CN109901920A (en) | Method for scheduling task and device, electric terminal | |
CN103455355B (en) | Android equipment, and asynchronous data uploading method and device for AdapterView of Android equipment | |
CN104219561B (en) | The method for cleaning and user equipment of a kind of offline video | |
CN110427256A (en) | Job scheduling optimization method, equipment, storage medium and device priority-based | |
CN105808342B (en) | method, judgment device and system for distributing client request | |
CN102752136A (en) | Method for operating and scheduling communication equipment | |
CN102521218B (en) | File combining method and file combining device | |
CN103543901B (en) | The method and apparatus generating menu | |
CN105653304B (en) | The switching method of operational mode, the switching device of operational mode and terminal | |
CN107463441A (en) | A kind of number of threads control method and equipment | |
CN111061981A (en) | Page management method and device, storage medium and electronic equipment | |
CN103501247A (en) | Method and device for processing high concurrency request | |
CN107179948A (en) | A kind of card writing method and system | |
CN109996313A (en) | Wireless connection method, device, equipment and storage medium | |
CN105824533A (en) | Method and device for loading picture and terminal | |
CN108287761A (en) | Method for recovering internal storage and device, terminal device and computer readable storage medium | |
CN107808662A (en) | Update the method and device in the syntax rule storehouse of speech recognition | |
CN105898077A (en) | Smartphone capable of automatically cleaning memory | |
CN109976790A (en) | Using update method, device, terminal and storage medium | |
CN113064677B (en) | Application running method and device, storage medium and electronic device | |
CN105554251B (en) | SIM card method of controlling switch and system based on mobile terminal | |
CN110489169A (en) | A kind of memory quick start method of system on chip |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160824 |
|
WD01 | Invention patent application deemed withdrawn after publication |