CN107450985B - Memory management method, mobile terminal and storage medium - Google Patents

Memory management method, mobile terminal and storage medium Download PDF

Info

Publication number
CN107450985B
CN107450985B CN201710622838.8A CN201710622838A CN107450985B CN 107450985 B CN107450985 B CN 107450985B CN 201710622838 A CN201710622838 A CN 201710622838A CN 107450985 B CN107450985 B CN 107450985B
Authority
CN
China
Prior art keywords
memory
application
value
preset
information
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
CN201710622838.8A
Other languages
Chinese (zh)
Other versions
CN107450985A (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.)
Beijing Everest Mobile Communication Co Ltd
Original Assignee
Beijing Everest Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Everest Mobile Communication Co Ltd filed Critical Beijing Everest Mobile Communication Co Ltd
Priority to CN201710622838.8A priority Critical patent/CN107450985B/en
Publication of CN107450985A publication Critical patent/CN107450985A/en
Application granted granted Critical
Publication of CN107450985B publication Critical patent/CN107450985B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The invention discloses a memory management method, a mobile terminal and a storage medium, wherein the method comprises the following steps: after the target application is started, acquiring a currently usable memory margin value; judging whether the memory residue value is smaller than a first preset memory value or not; when the memory allowance value is smaller than a first preset memory value, acquiring the current CPU occupancy rate; judging whether the CPU occupancy rate is smaller than a preset threshold value or not; and when the CPU occupancy rate is less than a preset threshold value, cleaning the background application until the memory residual value is greater than or equal to a first preset memory value. The invention also discloses a mobile terminal and a storage medium. According to the invention, when the memory surplus value is smaller than the first preset memory value and the CPU occupancy rate is lower than the preset threshold value, the memory cleaning operation is carried out, so that the situations that after the target application is started, the memory is insufficient when other applications or related applications are started, and the CPU occupancy rate is too high, the memory cleaning operation is executed to cause the mobile terminal to be jammed or halted are avoided, and the user experience is improved.

Description

Memory management method, mobile terminal and storage medium
Technical Field
The present invention relates to the field of mobile communications technologies, and in particular, to a memory management method, a mobile terminal, and a storage medium.
Background
The memory is an important component of the electronic device, and the running of all programs in the electronic device is performed in the memory, and the performance of the memory is crucial to the overall performance of the electronic device.
Because the memory resources of the electronic device system are limited, when there are many applications running in the electronic device system, the memory resources are insufficient. When the memory resource is insufficient, the memory resource is released by randomly selecting and killing the process corresponding to the running application. However, when the process corresponding to the selected application is killed, the problem of insufficient memory resources still cannot be solved, the above operations need to be repeatedly executed, so that the problems of slow release speed of the memory resources and low user experience are caused.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a memory management method, a mobile terminal and a storage medium, so as to solve the problems that the memory resource release speed of the existing electronic device is slow, and the use condition of the CPU is not considered, and the electronic device is stuck or crashed due to the fact that the CPU still executes the cleaning operation when the CPU is in the non-idle state.
In order to solve the above problem, the present invention provides a memory management method, which includes:
after the target application is started, acquiring a currently usable memory margin value;
judging whether the memory residue value is smaller than a first preset memory value or not;
when the memory allowance value is smaller than a first preset memory value, acquiring the current CPU occupancy rate;
judging whether the CPU occupancy rate is smaller than a preset threshold value or not;
and when the CPU occupancy rate is less than a preset threshold value, cleaning the background application until the memory residual value is greater than or equal to a first preset memory value.
As a further improvement of the present invention, after the step of determining whether the CPU occupancy is less than the preset threshold, the method further includes:
and when the CPU occupancy rate is greater than or equal to the preset threshold value, the current background application is not cleaned.
As a further improvement of the present invention, the step of cleaning the background application until the memory margin value is greater than or equal to the first preset memory value includes:
acquiring a cleaning ranking sequence of background applications;
and cleaning the background application according to the cleaning ranking sequence until the memory residue value is greater than or equal to a first preset memory value.
As a further improvement of the present invention, the step of obtaining a cleaning ranking order of the background application includes:
acquiring application information of each background application, wherein the application information comprises type information and parameter information;
filtering the background application according to the type information to obtain an application list, wherein the application list comprises a plurality of cleanable applications;
and sequencing the cleanable applications according to the parameter information to obtain a cleaning ranking sequence.
As a further improvement of the present invention, the method for filtering background applications according to type information to obtain an application list, wherein the application list includes a plurality of cleanable applications, and the method includes the steps of:
judging whether the type information of each background application is matched with first preset type verification information;
and if the type information is not matched with the first preset type verification information, adding the background application corresponding to the type information into the application list.
As a further improvement of the present invention, after the step of determining whether the type information of each background application matches the first preset type verification information, the method further includes:
if the type information is not matched with the first preset type verification information, judging whether the type information is matched with second preset type verification information;
and if the type information is matched with the second preset type verification information, adding the background application corresponding to the type information into the application list when the background application corresponding to the type information does not receive the instruction within a preset time period.
As a further improvement of the present invention, the step of sorting the plurality of cleanable applications in the application list according to the parameter information to obtain a cleaning ranking order includes:
adding cleanable applications with memory occupation values exceeding a second preset memory value to a first priority cleaning list, wherein parameter information comprises the memory occupation values, access time information and application process priorities;
adding a preset number of cleanable applications with access time information at the top to a second priority cleaning list;
adding the rest cleanable applications to a third priority cleaning list;
the cleanable applications in the first priority cleaning list, the second priority cleaning list and the third priority cleaning list are sorted according to the priority of the application process to obtain a cleaning ranking order.
As a further improvement of the present invention, the step of sorting the plurality of cleanable applications according to the parameter information to obtain a cleaning ranking order includes:
scoring each cleanable application according to the maximum process information of the occupied memory to obtain a first score, wherein the parameter information comprises the maximum process information of the occupied memory, total memory occupation information and application opening sequence information;
scoring each cleanable application according to the total memory occupation information to obtain a second score;
scoring each cleanable application according to the application opening sequence information to obtain a third score;
accumulating the first score, the second score and the third score corresponding to each cleanable application to obtain a total score of each cleanable application;
and sequencing the cleanable applications according to the total scores to obtain a cleaning ranking sequence.
As a further improvement of the present invention, after the step of cleaning the background application until the memory margin value is greater than or equal to the first preset memory value, the method further includes:
judging whether the cleared memory margin value is smaller than a third preset memory value, wherein the third preset memory value is larger than the first preset memory value;
and when the cleared memory margin value is smaller than a third preset memory value, continuing clearing the background application until the memory margin value is larger than or equal to the third preset memory value.
In order to solve the above problem, the present invention further provides a mobile terminal, which includes a processor, a memory coupled to the processor;
the processor and the memory are operable to implement the steps of any of the memory management methods described above.
In order to solve the above problem, the present invention further provides a storage medium having program data stored thereon, wherein the program data, when executed by a processor, implements the steps in the memory management method of any one of the above.
Compared with the prior art, the background application is cleaned after the target application is started, so that the residual amount of the memory is larger than or equal to the first preset memory value, the situation that the memory is insufficient when other applications or related applications are started after the target application is started is avoided, and the cleaning operation is repeatedly executed, so that the cleaning efficiency is improved.
Drawings
Fig. 1 is a flowchart of a memory management method according to a first embodiment of the present invention.
Fig. 2 is a flowchart of a memory management method according to a second embodiment of the invention.
FIG. 3 is a flowchart illustrating a memory management method according to a third embodiment of the present invention.
Fig. 4 is a flowchart illustrating a memory management method according to a fourth embodiment of the invention.
Fig. 5 is a flowchart of a memory management method according to a fifth embodiment of the invention.
Fig. 6 is a flowchart of a memory management method according to a sixth embodiment of the invention.
Fig. 7 is a flowchart of a memory management method according to a seventh embodiment of the invention.
Fig. 8 is a flowchart of a memory management method according to an eighth embodiment of the invention.
Fig. 9 is a flowchart of a ninth embodiment of a memory management method according to the invention.
FIG. 10 is a functional block diagram of a memory management device according to a first embodiment of the present invention.
FIG. 11 is a functional block diagram of a memory management device according to a second embodiment of the present invention.
FIG. 12 is a functional block diagram of a memory management device according to a third embodiment of the present invention.
FIG. 13 is a functional block diagram of a memory management device according to a fourth embodiment of the present invention.
FIG. 14 is a functional block diagram of a memory management device according to a fifth embodiment of the present invention.
FIG. 15 is a functional block diagram of a memory management device according to a sixth embodiment of the invention.
FIG. 16 is a functional block diagram of a memory management device according to a seventh embodiment of the invention.
Fig. 17 is a functional block diagram of a memory management device according to an eighth embodiment of the invention.
FIG. 18 is a functional block diagram of a ninth embodiment of a memory management device according to the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 shows an embodiment of the memory management method of the present invention. In this embodiment, the memory management method is applied to a memory management device, and the memory management device is located in a mobile terminal. Specifically, as shown in fig. 1, the memory management method includes:
in step S1, after the target application is started, a currently usable memory margin value is obtained.
Specifically, the memory margin value refers to a value of a usable memory after the current target application is started.
In step S2, it is determined whether the memory margin value is smaller than a first predetermined memory value. If the remaining memory value is smaller than the first predetermined memory value, step S3 is executed.
It should be noted that, if the memory margin value is greater than or equal to the first preset memory value, the background application is not cleaned.
Specifically, the first preset memory value is a preset value, and the first preset memory value should be larger than a memory value that needs to be occupied after any application on the mobile terminal is started.
In step S3, the current CPU occupancy is acquired.
And step S4, judging whether the CPU occupancy rate is less than a preset threshold value. If the CPU occupancy is less than the preset threshold, step S5 is executed.
Specifically, the current CPU occupancy of the mobile terminal is acquired, and when it is determined that the CPU occupancy is less than the preset threshold, that is, the CPU is in the idle state, step S5 is executed. It should be understood that, here, the current CPU non-occupancy rate may also be obtained, and when the CPU non-occupancy rate is greater than the preset value, that is, the CPU is in an idle state, the same technical effect as that achieved by the above-mentioned scheme is all within the protection scope of the present invention.
In step S5, the background application is cleared until the memory margin value is greater than or equal to the first preset memory value.
Specifically, background applications are cleaned to provide a memory, and the cleaning of the background applications is stopped until the memory margin value is greater than or equal to a first preset memory value.
In the embodiment, the background application is cleaned after the target application is started, so that the residual memory amount is larger than or equal to the first preset memory value, the situation that the memory is insufficient when other applications or related applications are started after the target application is started is avoided, and the cleaning operation is repeatedly executed, so that the cleaning efficiency is improved.
When the memory management method is applied to the use process of the memory management device, the background application is cleaned when the CPU is in an idle state, and the mobile terminal is prevented from being jammed or halted. Therefore, on the basis of the above embodiment, in other embodiments, referring to fig. 2, after the step S4, when the CPU occupancy is greater than or equal to the preset threshold, the step S10 is performed:
and step S10, not cleaning the current background application.
In this embodiment, if the CPU occupancy is greater than or equal to the preset threshold, that is, the CPU is in a busy state, and at this time, if the operation of cleaning the background application is continuously performed, the CPU occupancy needs to be occupied, so that the CPU occupancy is supersaturated, and the mobile terminal is jammed or crashed. Therefore, when the CPU is in a busy state, the current background application is not cleaned, the phenomenon that the mobile terminal is blocked or crashed is avoided, and the user experience is reduced.
When the memory management method is applied to the use process of the memory management device, background applications are cleaned according to the ranking sequence, and the applications which need to be used or are being used by a user are prevented from being cleaned. Therefore, in addition to the above embodiments, in other embodiments, as shown in fig. 3, step S5 includes:
and step S20, acquiring the cleaning ranking sequence of the background application.
Step S21, cleaning the background application according to the cleaning ranking order until the memory margin value is greater than or equal to the first preset memory value.
In this embodiment, by obtaining a cleaning ranking order of the background applications, and cleaning the background applications according to the cleaning ranking order, it is avoided that the background applications which are currently needed or to be used by a user are cleaned, and the cleaning ranking order may be sorted according to the memory occupancy values of the background applications, and the background applications with more memory occupancy are arranged in front of the background applications.
When the memory management method is applied to the use process of the memory management device, the cleaning ranking sequence of the background application is obtained according to the application information of the background application. Therefore, in addition to the above embodiments, in another embodiment, as shown in fig. 4, step S20 includes:
step S30, acquiring application information of each background application, where the application information includes type information and parameter information.
And step S31, filtering the background application according to the type information to obtain an application list, wherein the application list comprises a plurality of cleanable applications.
Specifically, filtering is performed according to the type information of the background application, the background application which needs to be used or is about to be used is filtered, the background application is not cleaned, and other background applications which can be cleaned are added into the application list and serve as objects which can be cleaned.
And step S32, sequencing the cleanable applications according to the parameter information to obtain a cleaning ranking order.
Specifically, cleanable applications in the application list are sorted according to the parameter information, so that a cleaning ranking order is obtained.
In this embodiment, the background application is filtered through the type information of the background application to obtain the cleanable application, so that the application to be used is filtered out, the cleaning is avoided, and the user experience is reduced.
When the memory management method is applied to the using process of the memory management device, the type information of the background application is matched to judge whether the background application needs to be cleaned. Therefore, in addition to the above embodiments, in another embodiment, as shown in fig. 5, step S31 includes:
step S40, determining whether the type information of each background application matches the first preset type verification information. If the type information does not match the first preset type verification information, step S41 is executed.
It should be noted that, if the type information matches the first preset type verification information, the background application corresponding to the type information is not added to the application list.
Specifically, the first preset type of verification information is preset type of verification information, and the background applications corresponding to the first preset type of verification information include preset white list applications, intelligent scene applications (such as navigation, music, download, step-counting applications, and the like), applications with a visual interface, and the like, which need to be frequently used or continuously used, and therefore need to be filtered out to prevent the applications from being cleaned.
Step S41, add the background application corresponding to the type information to the application list.
In this embodiment, by setting the first preset type verification information, the background application corresponding to the type information matched with the first preset type verification information is filtered, so that the background application frequently or continuously used by the user is prevented from being cleaned, and the user experience is not good.
When the memory management method is applied to the use process of the mobile terminal, part of applications need to be operated for a period of time and then cleaned. Therefore, on the basis of the above embodiment, in another embodiment, as shown in fig. 6, after the step S40, if the type information does not match the first preset type verification information, the step S50 is executed:
in step S50, it is determined whether the type information matches the second preset type verification information. If the type information matches the second predetermined type verification information, step S51 is executed.
It should be noted that, if the type information is not matched with the second preset type verification information, the background application corresponding to the type information is directly added to the application list.
Step S51, when the background application corresponding to the type information does not receive the instruction within the preset time period, add the background application corresponding to the type information to the application list.
Specifically, the application with the type information matched with the second preset type verification information is an application which needs to be run for a period of time, such as a game breakthrough application, after a user completes a certain breakthrough, the next breakthrough is not started, and after the user temporarily goes to busy other things, the game breakthrough application is cleared, so that poor experience is caused to the user. Therefore, when the type information of the background application is not matched with the first preset type verification information, whether the type information is matched with the second preset type verification information is judged, if the type information is matched with the second preset type verification information and the background application corresponding to the type application does not receive an instruction within a preset time period, the background application is added into an application list, the instruction is an internal instruction or an external instruction, for example, within 1 hour, the game break-through application does not receive any instruction, and the game break-through application is added into the application list to serve as a cleanable application.
In the embodiment, in order to prevent mistaken killing of some background applications which need to run for a period of time, second preset type verification information is set, and when the type information of the background applications is not matched with the first preset type verification information and is matched with the second preset type verification information and no instruction is received by the background applications within a preset period of time, the background applications are added into the application list, so that the problem of mistakenly killing background application processes is avoided, and user experience is improved.
The memory management method is applied to the using process of the memory management device, and the cleanable applications are sorted according to the parameter information. Therefore, in addition to the above embodiments, in another embodiment, as shown in fig. 7, the step S32 includes:
step S60, add cleanable applications whose memory usage values exceed a second preset memory value to the first priority cleaning list, where the parameter information includes the memory usage values, the access time information, and the application process priority.
Specifically, generally, an application includes one or more processes, and the application ordering in the embodiment of the present invention may be mainly determined according to three parameters: 1. an application process priority; 2. the application occupies the memory; 3. access time information of the application. Namely, the parameter information of each background application includes: memory occupation value, access time information and application process priority, wherein the access time information can be arranged from short to long according to the latest opening interval time. The memory occupancy value is a parameter most closely related to the memory, and therefore, cleanable applications with memory occupancy values exceeding a second preset memory value are added to the first priority cleaning list as background applications which are processed most preferentially to release the memory. The second predetermined memory value is preset, for example, can be set to 150M.
In step S61, a preset number of cleanable applications with access time information at the top are added to the second priority cleaning list.
Specifically, according to the access time information, a preset number of advanced cleanable applications, which is preset, for example, 3, is added to the second priority cleaning list. The second priority clearance list has a lower clearance priority than the first priority clearance list.
In step S62, the remaining cleanable applications are added to the third-priority clean list.
Specifically, the third priority scrubbing list has a lower scrubbing priority than the second priority scrubbing list.
Step S63, sorting cleanable applications in the first priority cleaning list, the second priority cleaning list, and the third priority cleaning list according to application process priorities to obtain a cleaning ranking order.
Specifically, the cleanable applications in the same priority cleaning list are sorted according to the application process priority of each cleanable application, and finally a cleaning ranking order is obtained.
In the embodiment, the cleanable applications are sorted according to the memory occupation value, the access time information and the application process priority, so that the cleaning ranking sequence is obtained, and the background applications are cleaned according to the cleaning ranking sequence, so that the purpose of quickly releasing the memory is achieved.
In another embodiment of applying the memory management method of the present invention to the using process of the memory management device, as shown in fig. 8, step S32 includes:
step S70, scoring each cleanable application according to the maximum process information of the occupied memory to obtain a first score, where the parameter information includes the maximum process information of the occupied memory, total memory occupied information, and application opening sequence information.
Step S71, scoring each cleanable application according to the total memory usage information to obtain a second score.
And step S72, scoring each cleanable application according to the application opening sequence information to obtain a third score.
Step S73, accumulating the first score, the second score and the third score corresponding to each cleanable application to obtain a total score of each cleanable application.
And step S74, sorting the cleanable applications according to the total scores to obtain a cleaning ranking order.
Specifically, the parameter information includes maximum process information of memory occupied by the cleanable applications, total memory occupied information, and application open sequence information, the cleanable applications are scored according to the three information respectively to obtain a first score, a second score, and a third score, the three scores are accumulated to obtain a total score corresponding to the cleanable applications, and then all the cleanable applications are sorted according to the total score, so as to obtain a cleaning ranking sequence.
In this embodiment, the cleanable applications are sorted according to the maximum process information of the memory occupied by the cleanable applications, the total memory occupied information, and the application opening sequence information, so as to obtain a cleaning ranking sequence, and then the background applications are cleaned according to the cleaning ranking sequence, so that the purpose of quickly releasing the memory is achieved.
The memory management method is applied to the using process of the memory management device, and aims to reduce the cleaning times. Therefore, in addition to the above embodiment, in another embodiment, as shown in fig. 9, after step S5, the method further includes:
in step S80, it is determined whether the cleared remaining memory value is smaller than a third predetermined memory value, where the third predetermined memory value is larger than the first predetermined memory value. If the cleared remaining memory value is smaller than the third predetermined memory value, step S81 is executed.
It should be noted that, if the cleared memory margin value is greater than or equal to the third preset memory value, the background application is not cleared.
Step S81, continue to clean the background application until the memory margin value is greater than or equal to the third preset memory value.
In this embodiment, for example, if the current remaining memory value is 32% and the first preset memory value is 35%, the background application only needs to be cleaned until the remaining memory value is greater than or equal to 35%, but in order to avoid that the memory is required to be cleaned again when the memory is applied by the next application, a third preset memory value is preferably set, where the third preset memory value is 40%, so that when the remaining memory value is less than 40% of the third preset memory value, the background application continues to be cleaned until the remaining memory value is greater than or equal to 40% of the third preset memory value, thereby reducing the number of times for cleaning the background application.
Fig. 10 shows an embodiment of the memory management device of the present invention. In this embodiment, the memory management apparatus includes a first obtaining module 10, a first determining module 11, a second obtaining module 12, a second determining module 13, and a first cleaning module 14.
The first obtaining module 10 is configured to obtain a currently available memory margin value after the target application is started; a first determining module 11, configured to determine whether the memory margin value is smaller than a first preset memory value; the second obtaining module 12 is configured to obtain a current CPU occupancy rate when the memory margin value is smaller than the first preset memory value; a second judging module 13, configured to judge whether the CPU occupancy rate is smaller than a preset threshold; the first cleaning module 14 is configured to clean the background application when the CPU occupancy rate is less than a preset threshold until the memory margin value is greater than or equal to a first preset memory value.
Based on the above embodiments, in other embodiments, referring to fig. 11, the memory management device further includes a stop clearing module 20. The stop cleaning module 20 is configured to not clean the current background application when the CPU occupancy rate is greater than or equal to a preset threshold.
On the basis of the above embodiment, in other embodiments, referring to fig. 12, the first cleaning module 14 includes an acquisition sub-module 141 and a cleaning sub-module 142.
The obtaining submodule 141 is configured to obtain a cleaning ranking order of the background application; the cleaning submodule 142 is configured to clean the background application according to the cleaning ranking order until the memory margin value is greater than or equal to a first preset memory value.
On the basis of the above embodiment, in other embodiments, referring to fig. 13, the obtaining sub-module 141 includes an application information obtaining sub-module 1411, a filtering sub-module 1412 and a sorting sub-module 1413.
The application information obtaining sub-module 1411 is configured to obtain application information of each background application, where the application information includes type information and parameter information; the filtering sub-module 1412 is configured to filter the background applications according to the type information to obtain an application list, where the application list includes a plurality of cleanable applications; the sorting submodule 1413 is configured to sort the plurality of cleanable applications according to the parameter information, so as to obtain a cleaning ranking order.
On the basis of the above embodiment, in other embodiments, referring to fig. 14, the filtering sub-module 1412 includes a first judgment unit 14121 and a first addition unit 14122.
The first determining unit 14121 is configured to determine whether the type information of each background application matches with first preset type verification information; a first adding unit 14122, configured to add, if the type information does not match the first preset type verification information, the background application corresponding to the type information to the application list.
In another embodiment, referring to fig. 15, the filtering sub-module 1412 further includes a second judging unit 14123 and a second adding unit 14124.
The second determining unit 14123 is configured to determine whether the type information matches the second preset type verification information if the type information does not match the first preset type verification information; a second adding unit 14124, configured to add, if the type information matches the second preset type verification information, the background application corresponding to the type information to the application list when the background application corresponding to the type information does not receive the instruction within the preset time period.
On the basis of the above-described embodiment, in other embodiments, referring to fig. 16, the sorting sub-module 1413 includes a first priority setting unit 14131, a second priority setting unit 14132, a third priority setting unit 14133, and an application process prioritization unit 14134.
The first priority setting unit 14131 is configured to add a cleanable application, of which a memory occupancy value exceeds a second preset memory value, to a first priority cleaning list, where the parameter information includes the memory occupancy value, access time information, and an application process priority; a second priority setting unit 14132 for adding a preset number of cleanable applications with access time information at the top to the second priority cleaning list; a third priority setting unit 14133 for adding the remaining cleanable applications to the third priority cleaning list; an application process priority ordering unit 14134, configured to order cleanable applications in the first priority cleaning list, the second priority cleaning list, and the third priority cleaning list according to application process priorities, so as to obtain a cleaning ranking order.
In another embodiment, referring to FIG. 17, the ranking sub-module 1413 includes a first scoring unit 14135, a second scoring unit 14136, a third scoring unit 14137, an accumulation unit 14138, and a score ranking unit 14139.
The first scoring unit 14135 is configured to score each cleanable application according to the maximum process information of the occupied memory to obtain a first score, where the parameter information includes the maximum process information of the occupied memory, total memory occupation information, and application opening sequence information; the second scoring unit 14136 is configured to score each cleanable application according to the total memory usage information to obtain a second score; a third scoring unit 14137, configured to score each cleanable application according to the application opening order information to obtain a third score; an accumulation unit 14138, configured to accumulate the first score, the second score, and the third score corresponding to each cleanable application to obtain a total score of each cleanable application; and the score sorting unit 14139 is configured to sort the plurality of cleanable applications according to the total scores to obtain a cleaning ranking order.
On the basis of the foregoing embodiment, in another embodiment, referring to fig. 18, the memory management device further includes a third determining module 30 and a second cleaning module 31.
The third determining module 30 is configured to determine whether the cleared remaining memory value is smaller than a third preset memory value, where the third preset memory value is larger than the first preset memory value; the second cleaning module 31 is configured to, when the cleaned memory margin value is smaller than a third preset memory value, continue cleaning the background application until the memory margin value is greater than or equal to the third preset memory value.
For other details of the technical solutions for implementing the modules in the memory management devices in the nine embodiments, reference may be made to the description of the memory management method in the embodiments, and details are not described herein again.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The embodiment also provides a mobile terminal comprising a processor, and a memory coupled to the processor. The memory stores the functional modules described in the above embodiments. The processor may implement the memory management method provided by the present application through the functional modules stored in the memory and described in the above embodiments.
The present embodiment further provides a storage medium for storing program data, which includes program data designed to execute the memory management method embodiments of the present application. The memory management method provided by the present application can be realized by executing the program data stored in the storage medium.
The embodiments of the present invention have been described in detail, but the present invention is only exemplary and is not limited to the embodiments described above. It will be apparent to those skilled in the art that any equivalent modifications or substitutions can be made within the scope of the present invention, and thus, equivalent changes and modifications, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the scope of the present invention.

Claims (7)

1. A memory management method, comprising:
after the target application is started, acquiring a currently usable memory margin value;
judging whether the memory residual value is smaller than a first preset memory value or not;
when the memory residual value is smaller than the first preset memory value, acquiring the current CPU occupancy rate;
judging whether the CPU occupancy rate is smaller than a preset threshold value or not;
when the CPU occupancy rate is smaller than the preset threshold value, cleaning background application until the memory residual value is larger than or equal to the first preset memory value;
the step of cleaning the background application until the memory margin value is greater than or equal to the first preset memory value includes:
acquiring a cleaning ranking sequence of the background application;
cleaning the background application according to the cleaning ranking sequence until the memory residue value is greater than or equal to the first preset memory value;
the step of obtaining the cleaning ranking order of the background application comprises the following steps:
acquiring application information of each background application, wherein the application information comprises type information and parameter information;
filtering the background application according to the type information, and filtering the background application which is required to be used or is about to be used at present to obtain a cleanable application list, wherein the application list comprises a plurality of cleanable applications;
sorting the cleanable applications according to the parameter information to obtain a cleaning ranking sequence;
the step of filtering the background application according to the type information, and filtering the background application which is needed to be used or is about to be used at present to obtain a cleanable application list includes:
judging whether the type information of each background application is matched with first preset type verification information;
if the type information is not matched with the first preset type verification information, judging whether the type information is matched with second preset type verification information; if the type information is matched with first preset type verification information, the background application corresponding to the type information is not added into the application list;
if the type information is matched with the second preset type verification information, when the background application corresponding to the type information does not receive an instruction within a preset time period, adding the background application corresponding to the type information into the application list; and if the type information is not matched with the second preset type verification information, adding the background application corresponding to the type information into the application list.
2. The memory management method according to claim 1, wherein after the step of determining whether the CPU occupancy rate is less than a preset threshold, the method further comprises:
and when the CPU occupancy rate is greater than or equal to the preset threshold value, not cleaning the current background application.
3. The memory management method according to claim 1, wherein the step of sorting the plurality of cleanable applications according to the parameter information to obtain the cleaning ranking order comprises:
adding cleanable applications with memory occupation values exceeding a second preset memory value to a first priority cleaning list, wherein the parameter information comprises the memory occupation values, access time information and application process priorities;
adding a preset number of cleanable applications at the front of the access time information to a second priority cleaning list;
adding the rest cleanable applications to a third priority cleaning list;
the cleanable applications in the first priority cleaning list, the second priority cleaning list and the third priority cleaning list are sorted according to the application process priority, and the cleaning ranking order is obtained.
4. The memory management method according to claim 1, wherein the step of sorting the plurality of cleanable applications according to the parameter information to obtain the cleaning ranking order comprises:
scoring each cleanable application according to the maximum process information of the occupied memory to obtain a first score, wherein the parameter information comprises the maximum process information of the occupied memory, total memory occupation information and application opening sequence information;
scoring each cleanable application according to the total memory occupation information to obtain a second score;
scoring each cleanable application according to the application opening sequence information to obtain a third score;
accumulating the first score, the second score and the third score corresponding to each cleanable application to obtain a total score of each cleanable application;
and sequencing the cleanable applications according to the total scores to obtain the cleaning ranking sequence.
5. The method according to claim 1, further comprising, after the step of cleaning the background application until the memory margin value is greater than or equal to the first preset memory value:
judging whether the cleared memory margin value is smaller than a third preset memory value, wherein the third preset memory value is larger than the first preset memory value;
and when the cleared memory margin value is smaller than the third preset memory value, continuing to clear the background application until the memory margin value is larger than or equal to the third preset memory value.
6. A mobile terminal comprising a processor, a memory coupled to the processor;
the processor and the memory being operable to implement the steps of the memory management method of any one of claims 1 to 5.
7. A storage medium having program data stored thereon, wherein the program data, when executed by a processor, implements the steps in the memory management method of any of claims 1-5.
CN201710622838.8A 2017-07-27 2017-07-27 Memory management method, mobile terminal and storage medium Active CN107450985B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710622838.8A CN107450985B (en) 2017-07-27 2017-07-27 Memory management method, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710622838.8A CN107450985B (en) 2017-07-27 2017-07-27 Memory management method, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN107450985A CN107450985A (en) 2017-12-08
CN107450985B true CN107450985B (en) 2021-05-18

Family

ID=60489143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710622838.8A Active CN107450985B (en) 2017-07-27 2017-07-27 Memory management method, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN107450985B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108459879B (en) * 2018-01-17 2021-08-17 宇龙计算机通信科技(深圳)有限公司 Method for preventing terminal from crashing and terminal
CN108710539B (en) * 2018-05-18 2021-03-16 珠海格力电器股份有限公司 Information processing method, terminal and readable storage medium
CN109299600B (en) * 2018-08-02 2021-07-13 珠海格力电器股份有限公司 Application locking and unlocking method and device, terminal and readable storage medium
CN109558297A (en) * 2018-11-27 2019-04-02 苏州思必驰信息科技有限公司 EMS memory management process and device
CN109582442A (en) * 2018-11-30 2019-04-05 北京微播视界科技有限公司 Processing method, electronic equipment and the computer storage medium of memory spilling OOM
WO2020206690A1 (en) * 2019-04-12 2020-10-15 深圳市欢太科技有限公司 Application cleaning method and apparatus, storage medium and electronic device
CN110543431A (en) * 2019-08-27 2019-12-06 Oppo(重庆)智能科技有限公司 Memory optimization method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408861A (en) * 2007-10-11 2009-04-15 鸿富锦精密工业(深圳)有限公司 Real time monitoring system and method of application program
CN105094936A (en) * 2015-09-24 2015-11-25 广东小天才科技有限公司 Background application program cleaning method and device applied to mobile terminal
CN106095063A (en) * 2016-06-15 2016-11-09 乐视控股(北京)有限公司 The power consumption management method of mobile terminal and power consumption management system

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729285B (en) * 2008-10-13 2014-04-02 大唐移动通信设备有限公司 Method for improving equipment reliability and communication equipment
CN102880516B (en) * 2012-09-13 2016-09-28 广东欧珀移动通信有限公司 A kind of mobile terminal adjusts the method and system of the response speed of input instruction
CN103024538A (en) * 2012-11-12 2013-04-03 北京奇虎科技有限公司 Memory management method and system
CN102946486A (en) * 2012-11-20 2013-02-27 惠州Tcl移动通信有限公司 Background application automatic clearing method based on mobile phone and mobile phone
CN104298612A (en) * 2014-09-30 2015-01-21 北京金山安全软件有限公司 Method and device for cleaning memory in mobile terminal and mobile terminal
CN105791614B (en) * 2014-12-24 2019-05-10 深圳Tcl数字技术有限公司 File scanning method and terminal
CN105893153A (en) * 2016-03-31 2016-08-24 北京百纳威尔无线通信设备有限公司 Memory cleaning method and device for mobile terminal
CN106095363B (en) * 2016-06-03 2019-04-26 Oppo广东移动通信有限公司 A kind of ameliorative way, device and the terminal of terminal Caton
CN106354659B (en) * 2016-08-29 2019-07-19 许继集团有限公司 A kind of method of the FLASH resource reclaim of embedded device
CN106407010A (en) * 2016-09-06 2017-02-15 北京珠穆朗玛移动通信有限公司 Internal memory management method and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408861A (en) * 2007-10-11 2009-04-15 鸿富锦精密工业(深圳)有限公司 Real time monitoring system and method of application program
CN105094936A (en) * 2015-09-24 2015-11-25 广东小天才科技有限公司 Background application program cleaning method and device applied to mobile terminal
CN106095063A (en) * 2016-06-15 2016-11-09 乐视控股(北京)有限公司 The power consumption management method of mobile terminal and power consumption management system

Also Published As

Publication number Publication date
CN107450985A (en) 2017-12-08

Similar Documents

Publication Publication Date Title
CN107450985B (en) Memory management method, mobile terminal and storage medium
CN106293924B (en) The EMS memory management process and device of Android system
CN106557369B (en) Multithreading management method and system
TWI628588B (en) System, method and terminal for cleaning memory
CN107391243B (en) Thread task processing equipment, device and method
CN110515820A (en) A kind of server failure maintaining method, device, server and storage medium
CN104298613A (en) Method for cleaning up system memory and terminal device
CN110704173A (en) Task scheduling method, scheduling system, electronic device and computer storage medium
CN108829510B (en) Thread binding processing method and device
CN106445604A (en) Clearing method and device for applications
WO2016188102A1 (en) Task processing method and device
CN109614168A (en) Memory Optimize Method and device
CN110737606B (en) Memory recovery processing method and device, electronic equipment and storage medium
CN115858180B (en) Time slicing method and device and electronic equipment
CN111258746A (en) Resource allocation method and service equipment
CN105302566A (en) Process optimizing method and system
WO2016145804A1 (en) Data processing and device
CN109117263B (en) Method and device for releasing memory of user terminal
WO2017185263A1 (en) Memory reclaiming method and apparatus
CN112214291A (en) Task scheduling method and device
CN103645983A (en) Method and device for generating journal file in domestic environment
CN116126937A (en) Job scheduling method, job scheduling device, electronic equipment and storage medium
CN106855824B (en) Task stopping method and device and electronic equipment
CN110941597B (en) Method and device for cleaning decompressed file, computing equipment and computer storage medium
CN113886376A (en) Data cleaning method and device, electronic equipment and medium

Legal Events

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