CN113722080A - Memory optimization method and device and computer storage medium - Google Patents

Memory optimization method and device and computer storage medium Download PDF

Info

Publication number
CN113722080A
CN113722080A CN202010442458.8A CN202010442458A CN113722080A CN 113722080 A CN113722080 A CN 113722080A CN 202010442458 A CN202010442458 A CN 202010442458A CN 113722080 A CN113722080 A CN 113722080A
Authority
CN
China
Prior art keywords
running
processes
priority
memory
real
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
Application number
CN202010442458.8A
Other languages
Chinese (zh)
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 Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202010442458.8A priority Critical patent/CN113722080A/en
Publication of CN113722080A publication Critical patent/CN113722080A/en
Pending legal-status Critical Current

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The disclosure relates to a memory optimization method, a memory optimization device and a computer storage medium, and relates to a memory optimization technology. The memory optimization method provided by the present disclosure is applied to a mobile terminal, and includes: when the first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes; closing the process of which the real-time priority is lower than a preset priority threshold in the running process; the preset condition at least comprises that the size of a memory space occupied by the running process reaches or exceeds a preset first memory threshold; the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes. According to the technical scheme, the calculation of the real-time priority of the process is triggered by the preset condition, so that part of the process is selected to be closed, the resources occupied by the process are released in time, and the frequency of the terminal equipment entering the low-memory state is reduced.

Description

Memory optimization method and device and computer storage medium
Technical Field
The present disclosure relates to memory optimization technologies, and in particular, to a memory optimization method and apparatus, and a computer storage medium.
Background
The memory resources of the mobile terminal are limited, and one or more processes occupy the memory resources whenever the application program APP is started. Therefore, in order to create a new process or run a more important process within a limited resource, it is necessary to clear the old process and recycle resources such as memory. To determine which processes to retain or terminate, the system places each process in an "importance hierarchy" based on the components that are running in the process and the state of those components. If necessary, the system will kill the least important process first, then kill the process with the lower importance, and so on, to recover the system resources. One of the processes is lowmemkiller, which is triggered when the upper-layer killing strategy is completed but the memory required by the operation of a newly-built process or an important process cannot be met.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a memory optimization method, apparatus, and computer storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a memory optimization method applied to a mobile terminal, including:
when first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
In the above memory optimization method, the determining a real-time priority of each process in the running processes includes:
and determining the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process, wherein the initial priority of each process is contained in the attribute information of the process, and the second information of each process at least comprises the size of the occupied memory space and/or the activity of the process.
In the above memory optimization method, the determining the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process includes:
when the second information of each process comprises the size of the occupied memory space, comparing the size of the memory space occupied by each process in the running process with a second memory threshold value respectively;
when the size of the memory space occupied by the process is smaller than or equal to the second memory threshold, increasing the initial priority of the process to obtain the real-time priority of the process;
and when the size of the memory space occupied by the process is larger than the second memory threshold, reducing the initial priority of the process to obtain the real-time priority of the process.
In the above memory optimization method, the determining the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process includes:
when the second information of each process comprises the process activity, comparing the process activity of each process in the running process with a preset first activity threshold value respectively;
and when the process activity of the process is smaller than the first activity threshold value, reducing the initial priority of the process to obtain the real-time priority of the process.
In the above memory optimization method, the reducing the initial priority of the process to obtain the real-time priority of the process includes:
sequencing all processes with process activity degrees smaller than the first activity degree threshold value according to the sequence of the process activity degrees from low to high;
and sequentially reducing the initial priority of each process according to the sequence to obtain the real-time priority of the process, wherein the reduced amplitude of the initial priority of each process in the sequence is inversely related to the position of the process in the sequence.
The memory optimization method further includes:
when the first information of the running process meets the preset condition, if the running process is determined to have a process with the process activity degree lower than a preset second activity degree threshold, closing the process with the process activity degree lower than the preset second activity degree threshold, wherein the second activity degree threshold is smaller than the first activity degree threshold.
According to a second aspect of the embodiments of the present disclosure, there is provided a memory optimization apparatus, including:
the system comprises a first module, a second module and a third module, wherein the first module is used for determining the real-time priority of each process in the running processes when first information of the running processes meets a preset condition, and the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
the second module is used for closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
In the memory optimization device, the first module includes:
and the priority calculating submodule is used for determining the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process, wherein the initial priority of each process is contained in the attribute information of the process, and the second information of each process at least comprises the size of the occupied memory space and/or the activity of the process.
In the memory optimization device, the priority calculation sub-module includes:
the first comparison submodule is used for comparing the size of the memory space occupied by each process in the running process with a second memory threshold value when the second information of each process comprises the size of the occupied memory space;
the first adjusting submodule is used for increasing the initial priority of the process to obtain the real-time priority of the process when the size of the memory space occupied by the process is smaller than or equal to the second memory threshold;
and the second adjusting submodule is used for reducing the initial priority of the process to obtain the real-time priority of the process when the size of the memory space occupied by the process is larger than the second memory threshold value.
In the memory optimization device, the priority calculation sub-module includes:
the second comparison submodule is used for comparing the process activity of each process in the running process with a preset first activity threshold when the second information of each process comprises the process activity;
and the third adjusting submodule is used for reducing the initial priority of the process to obtain the real-time priority of the process when the process activity of the process is smaller than the first activity threshold value.
In the memory optimization device, the third adjusting submodule includes:
the sequencing submodule is used for sequencing all the processes with the process activity degrees smaller than the first activity degree threshold value according to the sequence of the process activity degrees from low to high;
and the determining submodule is used for sequentially reducing the initial priority of each process according to the sequence to obtain the real-time priority of the process, wherein the reduced amplitude of the initial priority of each process in the sequence is inversely related to the position of the process in the sequence.
Wherein, the memory optimization device further comprises:
and the third module is used for closing the process with the process activity degree lower than the preset second activity degree threshold value if the process with the process activity degree lower than the preset second activity degree threshold value exists in the running process when the first information of the running process meets the preset condition, wherein the second activity degree threshold value is smaller than the first activity degree threshold value.
According to a third aspect of the embodiments of the present disclosure, there is provided a memory optimization apparatus, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium having instructions which, when executed by a processor of a terminal device, enable the terminal device to perform a memory optimization method, the method comprising:
when first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the technical scheme, the calculation of the real-time priority of the process is triggered through the preset conditions, so that part of the process is closed according to the real-time priority of the process, resources occupied by the process can be released in time, and the frequency of the terminal equipment entering a low memory state is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a flow chart illustrating a method for memory optimization according to an example embodiment.
Fig. 2 is a flow chart illustrating a method for memory optimization according to an example embodiment.
Fig. 3 is a block diagram illustrating a memory optimization device in accordance with an example embodiment.
Fig. 4 is a block diagram illustrating a memory optimization device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
In the related technology, when the terminal device enters the lowmem state, the process is searched and killed according to the built-in strategy. With the frequent use of the multifunctional application on the terminal device by the user, the terminal device is very easy to enter the lowmem state. When entering the lowmem state, the problems of screen jam, too fast power consumption of the device and the like occur. And the process searching and killing mode of lowmemkiller is adopted, so that the process required by the user can be closed, and the user experience is influenced.
The method and the device can select to close part of the processes in time according to the real-time condition of the running process before the terminal equipment enters the lowmem state so as to release the memory space, avoid the terminal equipment from frequently entering the lowmem state and improve the performance of the terminal equipment.
Based on the above thought, the present disclosure provides a memory optimization method, device and computer storage medium.
Fig. 1 is a flow chart illustrating a method for memory optimization according to an example embodiment. As shown in fig. 1, the method includes the operations of:
in step S101, when the first information of the running process meets a preset condition, determining a real-time priority of each process in the running process, where the first information of the running process at least includes a size of a memory space occupied by the running process and/or a total number of processes of the running process;
in step S102, closing a process, of which the real-time priority is lower than a preset priority threshold, in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
Herein, the first information of the running process includes a size of a memory space occupied by the running process and/or a total number of processes of the running process. The size of the memory space occupied by the process can reflect the size of the currently usable resources of the terminal equipment, so that the current state of the terminal equipment is represented. That is, the smaller the memory space occupied by the process is, the more resources the terminal device can use at present, and at this time, the faster the terminal device runs, and the better the running performance is. The larger the memory space occupied by the process is, the less resources can be used by the terminal device at present, and at this time, the running speed of the terminal device is slower and the running performance is poorer. The total number of processes running the process may also reflect the current state of the terminal device. That is, the smaller the total number of processes, the less the software/hardware resources of the terminal device are occupied, and at this time, the faster the operation speed of the terminal device is, the better the operation performance is. And the larger the total number of processes is, the more the software/hardware resources of the terminal device are occupied, and at this time, the running speed of the terminal device is slower and the running performance is poorer. It can thus be seen that the current state of the terminal device can be determined by means of the first information of the running process.
In the step S101, the preset conditions at least include that the size of the memory space occupied by the following running processes reaches or exceeds a preset first memory threshold, and/or the total number of the running processes reaches or exceeds a preset total number of the running processes threshold. The fact that the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold means that the size of the memory space occupied by the running process is too large, and the terminal device is considered to have a risk of entering a low memory state. The fact that the total number of the processes running reaches or exceeds the preset threshold value of the total number of the processes means that the number of the currently running processes is too large, and the terminal device is considered to have the risk of entering a low memory state.
Herein, the size of the memory space occupied by the running process reaches or exceeds the preset first memory threshold, which may be that the sum of the sizes of the memory spaces occupied by all the processes of the running process reaches or exceeds the preset first memory threshold. At this time, the first memory threshold is related to the overall size of the memory space of the terminal device. And in order to avoid that the terminal device frequently enters the low memory state, the first memory threshold value needs to be smaller than the memory space value used by the terminal device in the low memory state. For example, when the terminal device has used 80% of the memory space, the terminal device enters the memory state, and the first memory threshold in this embodiment is lower than 80%. Thus, when the size of the memory space occupied by the running process reaches the first memory threshold, that is, the size of the memory space occupied by the running process does not reach 80% of the memory space, the preset condition of the embodiment is met, and the subsequent operation is performed.
The size of the memory space occupied by the running process reaches or exceeds the preset first memory threshold, or may be that the sum of the sizes of the memory spaces occupied by the associated processes in the running process reaches or exceeds the preset first memory threshold. At this time, the first memory threshold is related to the size of the memory space that can be occupied by the associated process. And respectively setting corresponding first memory threshold values for different associated processes. For example, for a certain APP that is enabled, multiple processes whose association triggers belong to one kind of associated process. At this time, the first memory threshold may be set for processes associated with different classes of APPs, respectively. Suppose that a corresponding first memory threshold is set to be A for an association process triggered by a shopping APP. And setting a corresponding first memory threshold value as B for the correlation process triggered by the video APP. In this way, when the user activates the shopping APP to trigger the multiple associated processes, if the sum of the memory spaces occupied by the multiple associated processes reaches or exceeds the corresponding first memory threshold a, it is considered that the preset condition of the embodiment is satisfied, and then the subsequent operation is performed. When a user activates a video APP to trigger multiple associated processes, if the sum of the memory spaces occupied by the multiple associated processes reaches or exceeds the corresponding first memory threshold B, it is considered that the preset condition of this embodiment is satisfied, and then the subsequent operation is performed.
The size of the memory space occupied by the running process may reach or exceed the preset first memory threshold, or the size of the memory space occupied by a single process of the running process may reach or exceed the preset first memory threshold. At this time, the first memory threshold is related to the size of the memory space that can be occupied by each process. Corresponding first memory threshold values are set for different processes respectively. When the size of the memory space occupied by any process reaches or exceeds the corresponding first memory threshold, it is considered that the preset condition of the embodiment is satisfied and the subsequent operation is performed.
When the total number of the processes running reaches or exceeds a preset total number threshold, the total number threshold is related to the capability of the terminal device for supporting the simultaneously running processes. I.e. the higher the software/hardware performance of the terminal device itself, the larger its process total threshold value. The lower the software/hardware performance of the terminal device itself, the smaller the process count threshold. The preset process total number threshold may be determined in an initialization configuration in an operating system of the terminal device, or may be set according to a user requirement.
The real-time priority of each process in the running processes indicates the importance degree of each process in all the running processes in the current state of the terminal equipment. The more important a process is, the higher its corresponding real-time priority. Since real-time priority represents the importance of a process. Therefore, the real-time priority and the priority threshold of the process can be used as a reference index for closing the process.
The priority threshold may be set for the entire running process, that is, the real-time priority of the process is lower than the priority threshold, and the processes with lower priority, that is, the processes are considered to belong to unimportant processes, and may be selected to be closed. Therefore, the excessive memory space occupied by the running process can be released, and the terminal equipment is prevented from entering a low memory state.
The priority threshold may also be set for different processes. For example, processes with the same initial priority may be considered processes with the same attributes for which the same priority threshold may be set. Thus, when the real-time priority of a process is lower than the corresponding priority threshold, the process can be considered as an unimportant process, and can be selected to be closed. Wherein, the priority threshold corresponding to the processes with different initial priorities may not be the same. That is, the criteria for determining the processes that can be shut down are not the same for different processes. Therefore, the real-time state of the running process can be better determined according to the attributes (namely the initial priorities) of different processes, part of the memory space is reasonably released, and the terminal equipment is prevented from repeatedly entering the low memory state.
Herein, the preset priority threshold may be determined in an initialization configuration in an operating system of the terminal device, or may be set according to a user requirement.
As can be seen from the above description, according to the technical solution of the embodiment, when it is determined that the first information of the running process meets the preset condition, it can be considered that the terminal device has a risk of entering the low memory state. At the moment, part of the processes can be selected to be closed by calculating the real-time priority of each running process, so that the effects of clearing the memory space, avoiding the terminal equipment from frequently entering a low memory state and improving the performance of the terminal equipment are achieved.
This embodiment further provides a method for optimizing a memory, where the determining a real-time priority of each process in an operating process includes:
and determining the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process, wherein the initial priority of each process is contained in the attribute information of the process, and the second information of each process at least comprises the size of the occupied memory space and/or the activity of the process.
Herein, determining the real-time priority of each process according to the initial priority of each process and the second information of each process indicates that when a preset condition (that is, the terminal device has a risk of entering a low memory state) is met, the real-time priority of the process needs to be determined, so as to determine whether to close the process. The initial priority of the process can characterize the importance of each process in all processes, that is, indirectly indicate the ability of the process to accept the shutdown operation in the case of insufficient memory. The initial priority of each process, which is typically static configuration data, may be considered a default set of priorities. For example, the initial priority of a process may be determined using a set adj parameter in attribute information of the process. And under the condition that the preset condition is met, when the closable process is selected, only the initial priority of the process is considered to be insufficient to reflect the actual importance of each process in the current state. At this time, there may be other factors that affect the importance of each process.
For example, the memory space occupied by each process is different, and the occupied memory space directly affects the performance of the operating system of the terminal device. Therefore, based on the initial priority of the process, the initial priority can be dynamically adjusted according to the size of the memory space occupied by the process, and the real-time priority of the process is obtained. That is, the real-time priority of each process may be determined according to the initial priority of each process in the running process and the size of the memory space occupied by each process.
For another example, the process activity may represent the frequency with which the process is operated within the set duration, i.e., the higher the frequency with which the process is operated within the set duration, the higher the process activity of the process. The higher the activity of the process, the more the user needs to remain in the background. Therefore, based on the initial priority of the process, the initial priority can be dynamically adjusted in combination with the activity of the process, and the real-time priority of the process is obtained. That is, the real-time priority of each process may be determined based on the initial priority of each process in the running process, as well as the process liveness of each process.
It can be seen that, in the embodiment, when the real-time priority of the process is determined, on the basis of the initial priority, a plurality of factors affecting the priority are introduced to adjust the initial priority, so as to obtain the real-time priority of the process. Therefore, before the terminal equipment enters the low memory state, part of processes can be selected to be closed according to the real-time priority of the processes, so that part of resources can be released closer to the actual requirement of the terminal equipment, and the problem that the terminal equipment frequently enters the low memory state is solved.
This embodiment further provides a method for optimizing a memory, where the method determines a real-time priority of each process according to an initial priority of each process in an operating process and second information of each process, and includes:
when the second information of each process comprises the size of the occupied memory space, comparing the size of the memory space occupied by each process in the running process with a second memory threshold value respectively;
when the size of the memory space occupied by the process is smaller than or equal to a second memory threshold, increasing the initial priority of the process to obtain the real-time priority of the process;
and when the size of the memory space occupied by the process is larger than the second memory threshold, reducing the initial priority of the process to obtain the real-time priority of the process.
The second memory threshold may be used as a criterion for determining whether the memory space occupied by the process is too large. The initial priority of the process can be adjusted according to the comparison result of the memory space occupied by the process and the preset second memory threshold, and the adjusted priority is determined as the real-time priority of the process.
When the size of the memory space occupied by the process is less than or equal to the second memory threshold, the size of the memory space occupied by the process can be considered reasonable. At this time, the initial priority of the process may be increased to obtain the real-time priority of the process. In this way, the process can be kept as behind as possible, i.e., the process is less likely to be selected to be closed. Correspondingly, when the size of the memory space occupied by the process is larger than the second memory threshold, the memory space occupied by the process can be considered to be too large. Thus, the initial priority of the process may be reduced, resulting in a real-time priority of the process. Therefore, the process is high in possibility of being selectively closed, and can be closed in time under the condition that the memory occupies too much, so that resources are reasonably released, and the terminal equipment is prevented from entering a low memory state.
Herein, the preset second memory threshold may include one or more thresholds. When the preset second memory threshold includes one threshold, it indicates that the criterion for determining whether the memory space occupied by the processes is too large is uniform, that is, the size of the memory space occupied by any one or more processes in all running processes is larger than the memory threshold, that is, the memory space occupied by the one or more processes is considered to be too large. When the preset second memory threshold includes a plurality of thresholds, it indicates that all the running processes can be classified, and the second memory thresholds corresponding to the processes of each category are different. That is, the criteria for judging whether the memory space occupied by the processes is too large are different for the processes of different types. For example, the processes with the same initial priority are divided into the processes of the same category, and the average value of the memory space occupied by the processes of the same category may be used as the second memory threshold corresponding to the processes of the category. And when the size of the memory space occupied by any process belonging to the category is larger than the corresponding second memory threshold, the process is considered to occupy too large memory space. The preset second memory threshold may be determined in an initialization configuration in an operating system of the terminal device, or may be set according to a user requirement.
Therefore, in this embodiment, the initial priority of the process is dynamically adjusted according to the size of the memory space occupied by the process, so as to obtain the real-time priority of the process. The method can more accurately reflect the importance degree of each process in the current scene, thereby more accurately determining the selected closed process, fundamentally optimizing the memory management of the mobile phone, searching and killing the processes in time, releasing resources and avoiding the terminal equipment from entering a low memory state.
This embodiment further provides a method for optimizing a memory, where the method determines a real-time priority of each process according to an initial priority of each process in an operating process and second information of each process, and includes:
when the second information of each process comprises the process activity, comparing the process activity of each process in the running process with a preset first activity threshold respectively;
and when the process activity of the process is smaller than the first activity threshold value, reducing the initial priority of the process to obtain the real-time priority of the process.
The first activity threshold may be used as a criterion for determining whether the process is a user common process. That is, the initial priority of the process may be adjusted according to the comparison result between the process activity of the process and the preset first activity threshold, and the adjusted priority may be determined as the real-time priority of the process.
When the process activity of a process is lower than a first activity threshold, the process may be considered to belong to a process that is not commonly used by the user. At this time, the initial priority of the process may be reduced to obtain the real-time priority of the process. Therefore, the possibility that the process is kept in the background can be reduced, namely the possibility that the process is selected to be closed is higher, and the process can be closed in time under the condition that the memory is excessively used, so that the resources are reasonably released, and the terminal equipment is prevented from entering a low memory state.
In addition, when the process activity of a process is greater than or equal to the activity threshold, the process may be considered to belong to a process commonly used by the user. For the process commonly used by the user, the initial priority may be kept unchanged according to the actual requirement, or the initial priority may be dynamically increased, which may not be particularly limited.
Herein, the preset activity threshold includes information reflecting the condition that the process is called. For example, the liveness threshold may be a minimum number of calls allowed within a set length of time. Or the frequency of calls in a unit time length, etc. The liveness threshold may also be the longest time interval between two adjacent calls, etc. The preset activity threshold may be determined in an initialization configuration in an operating system of the terminal device, or may be set according to a user requirement.
Therefore, in this embodiment, the initial priority of the process is dynamically adjusted according to the process activity of the process, so as to obtain the real-time priority of the process. The method can more accurately reflect the importance degree of each process in the current scene, thereby more accurately determining the closed process, fundamentally optimizing the memory management of the mobile phone, searching and killing the processes in time, releasing resources and avoiding the terminal equipment from entering a low memory state.
This embodiment further provides a method for optimizing a memory, where the method includes reducing an initial priority of a process to obtain a real-time priority of the process, and includes:
sequencing all processes with the process liveness smaller than a first liveness threshold value according to the sequence of the process liveness from low to high;
and sequentially reducing the initial priority of each process according to the sequence to obtain the real-time priority of the process, wherein the reduction amplitude of the initial priority of each process in the sequence is inversely related to the position of the process in the sequence.
As introduced above, processes having a process activity below the first activity threshold may be determined to belong to processes that are not commonly used by the user. For the less common processes, the reduction of the initial priority may not be the same for the less common processes, because the liveness may also not be the same. For example, all processes with process liveness lower than the first liveness threshold may be sorted in order of process liveness from low to high, thereby indicating that the probability that all running processes remain in the background is from low to high. The process is ranked according to the rank order, the process is ranked according to the process from low to high, the process is ranked according to the process from low to high, and the process is ranked according to the process.
As can be seen, in this embodiment, when adjusting the initial priority for the processes with the process liveness smaller than the first liveness threshold, the adjustment amplitude corresponding to each process is determined according to the process liveness ranking of the processes, and the initial priority of each process in the ranking is reduced according to the corresponding adjustment amplitude, so as to obtain the real-time priority of each process. The real-time priority determined by the method can more accurately reflect the real-time demand degree of the user side for each process in the current scene, so that the closed process is more accurately determined, the mobile phone memory management is fundamentally optimized, the processes are searched and killed in time, resources are released, and the terminal equipment is prevented from entering a low memory state.
The present embodiment further provides a memory optimization method, where the method further includes:
when the first information of the running process meets the preset condition, if the running process is determined to have a process with the process activity degree lower than a preset second activity degree threshold value, closing the process with the process activity degree lower than the preset second activity degree threshold value, wherein the second activity degree threshold value is smaller than the first activity degree threshold value.
The preset second activity threshold may be used as a criterion for determining whether the process is to be invoked. I.e., processes having a process activity below a preset second activity threshold, may be considered long inactive processes with a very low likelihood of being used. Therefore, when the first information of the running processes meets the preset condition, that is, under the condition that the memory of the terminal device is excessive, the processes with the process activity lower than the preset second activity threshold value can be selected to be directly closed. After closing the processes, the subsequent operations in the above embodiment may be continued, that is, determining the real-time priority of each process in the surviving processes, and selecting to close the processes below the priority threshold.
As introduced above, the first activity threshold may be used as a criterion for determining whether a process is a user-friendly process, and may be used to adjust the priority of the process according to the comparison of the activity of the process with the first activity threshold. And the second liveness threshold is used as a criterion for judging whether the process is called. The result of the comparison of the process activity level to the second activity level threshold may be used directly to determine whether the process is shut down. Therefore, the second activity threshold needs to be less than the first activity threshold. The preset second activity threshold may be determined in an initialization configuration in an operating system of the terminal device, or may be set according to a user requirement.
Therefore, in this embodiment, the process with the excessively low activity is directly closed by using the comparison result between the activity of the process and the second activity threshold. The mobile phone memory management is fundamentally optimized, the process is timely checked and killed, resources are released, and the terminal device is prevented from repeatedly entering a low memory state.
Fig. 2 is a flow chart illustrating a method for memory optimization according to an example embodiment. As shown in fig. 2, the following operations are included:
step S201: and determining the size of the memory space occupied by the running process of the terminal equipment and/or the total number of the processes of the running process, and meeting the preset conditions.
In this embodiment, the size of the memory space occupied by the running process reaches or exceeds the preset first memory threshold, that is, the preset condition is considered to be satisfied.
The total number of processes running the process reaches or exceeds a preset total number threshold of processes, and the preset condition is also considered to be met.
When the size of the memory space occupied by the running process and/or the total number of the processes of the running process meet preset conditions, the current state of the terminal equipment can be considered to be easily in a low memory state. Therefore, in order to avoid that the terminal device frequently enters a low memory state and affects the normal operation of the terminal device, the process needs to be cleared in time to release part of the resources.
Step S202: and respectively determining the real-time priorities of all the processes which are currently running according to a preset mode.
Wherein all processes currently running include all processes currently alive.
In this step, when the real-time priorities of all currently running processes are respectively determined according to a preset mode, the initial priority of the currently running process may be read first, and then the initial priority is adjusted according to one or more factors of the size of the memory space occupied by the process, the activity of the process and the total number of the processes, so as to obtain the real-time priority.
For example, the size of the memory space occupied by the process may be compared with a memory threshold corresponding to the initial priority (i.e., the second memory threshold described above), and the initial priority may be adjusted according to the comparison result. When the memory space occupied by the process is smaller than the memory threshold corresponding to the initial priority, the initial priority of the process can be increased, and the real-time priority of the process is obtained. When the size of the memory space occupied by the process is greater than or equal to the memory threshold corresponding to the initial priority, the initial priority of the process can be reduced, and the real-time priority of the process is obtained. The memory threshold corresponding to the initial priority may be determined according to an average value of memory spaces occupied by all processes of the same initial priority.
For another example, the process activity of the process may be compared with a set first activity threshold, and the initial priority may be adjusted according to the comparison result. When the process activity of the process reaches or exceeds the set first activity threshold, the initial priority of the process can be increased to obtain the real-time priority of the process. When the process activity of the process is lower than the set first activity threshold, the initial priority of the process can be reduced, and the real-time priority of the process is obtained.
For another example, when only the preset condition includes that the size of the memory space occupied by the running process reaches or exceeds the preset first memory threshold, the total number of the processes running the process is not determined. The total number of running processes may indicate the current running load of the terminal device, and the current running load may directly affect the priority of all running processes. Therefore, the total number of the running processes can be used as a factor for adjusting the initial priority of the processes, that is, the total number of the running processes can be compared with a preset process total number threshold, and the initial priority can be adjusted according to the comparison result. When the total number of processes is greater than or equal to the total number of processes threshold, the initial priorities of all the processes can be reduced to obtain the real-time priorities of all the processes. When the total number of processes is smaller than the threshold value of the total number of processes, the initial priorities of all the processes can be increased to obtain the real-time priorities of all the processes.
If the initial priority of the process is adjusted according to two or more of the above factors, the initial priority of the process can be adjusted in various ways.
For example, the following formula may be used to weight and calculate various factors to obtain real-time priorities of the processes.
The real-time priority is equal to the initial priority + α first modulation amplitude + β second modulation amplitude + γ third modulation amplitude.
Wherein, alpha, beta and gamma are weighting coefficients of each priority factor;
the first adjusting amplitude is the amplitude of priority adjustment based on the size of the memory space occupied by the process;
the second adjusting amplitude is the amplitude of adjusting the priority based on the total number of the processes;
the third adjustment amplitude is the adjustment of the priority amplitude based on the process activity level.
As another example, the initial priority of a process may be adjusted in turn according to various factors. The initial priority of the process can be adjusted according to the size of the memory space occupied by the process to obtain the first dynamic priority. And finally, adjusting the second dynamic priority according to the total number of the processes, and determining the finally adjusted priority as the real-time priority of the processes. For a specific manner of adjusting the priority according to various factors, reference may be made to corresponding contents in the foregoing embodiments, which are not described herein again.
Step S203: and closing the process of which the real-time priority is lower than the preset priority threshold in the running process.
If the real-time priorities of one or more processes are lower than the priority threshold, the processes are considered to belong to the processes with lower priorities. Under the condition that the operating memory occupies too much, the processes with lower priorities can be closed to release part of the memory space, and the condition that the operating performance is influenced by the system entering a low memory state is avoided.
In addition, after the operation in step S201 is performed, it may be determined whether there is a long-time inactive process in the running processes, that is, a process with a process activity lower than the second activity threshold (for example, no operation is performed within 30 minutes), and the checking and killing may be performed directly. Thereafter, the operation proceeds to step S202.
Fig. 3 is a block diagram illustrating a memory optimization device in accordance with an example embodiment. As shown in fig. 3, the apparatus comprises a first module 31 and a second module 32.
The first module 31 is configured to determine a real-time priority of each process in the running processes when first information of the running processes meets a preset condition, where the first information of the running processes at least includes a memory space occupied by the running processes and/or a total number of the running processes;
a second module 32, configured to close a process, of which the real-time priority is lower than a preset priority threshold, in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
The embodiment further provides a memory optimization device, wherein the first module includes:
and the priority calculation submodule is configured to determine the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process, wherein the initial priority of each process is contained in the attribute information of the process, and the second information of each process at least comprises the size of the occupied memory space and/or the activity of the process.
The present embodiment further provides a memory optimization device, wherein the priority calculation submodule includes:
the first comparison submodule is configured to compare the size of the memory space occupied by each process in the running process with a second memory threshold value when the second information of each process comprises the size of the occupied memory space;
the first adjusting submodule is configured to increase the initial priority of the process to obtain the real-time priority of the process when the size of the memory space occupied by the process is smaller than or equal to a second memory threshold;
and the second adjusting submodule is configured to reduce the initial priority of the process to obtain the real-time priority of the process when the size of the memory space occupied by the process is larger than a second memory threshold.
The present embodiment further provides a memory optimization device, wherein the priority calculation submodule includes:
the second comparison submodule is configured to compare the process activity of each process in the running process with a preset first activity threshold when the second information of each process comprises the process activity;
and the third adjusting submodule is configured to reduce the initial priority of the process to obtain the real-time priority of the process when the process activity of the process is smaller than the first activity threshold value.
The present embodiment further provides a memory optimization apparatus, wherein the third adjusting submodule includes:
the sequencing submodule is configured to sequence all the processes with the process activity degrees smaller than the first activity degree threshold value according to the sequence of the process activity degrees from low to high;
and the determining submodule is configured to reduce the initial priority of each process in sequence according to the sequence to obtain the real-time priority of the process, wherein the reduction amplitude of the initial priority of each process in the sequence is inversely related to the position of the process in the sequence.
This embodiment also provides a memory optimization device, and the device further includes:
and the third module is configured to, when the first information of the running process meets the preset condition, if it is determined that a process with a process activity lower than a preset second activity threshold exists in the running process, close the process with the process activity lower than the preset second activity threshold, wherein the second activity threshold is smaller than the first activity threshold.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 4 is a block diagram illustrating a memory-optimized electrical device 400, according to an example embodiment. For example, the apparatus 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 400 may include one or more of the following components: processing components 402, memory 404, power components 406, multimedia components 408, audio components 410, input/output (I/O) interfaces 412, sensor components 414, and communication components 416.
The processing component 402 generally controls overall operation of the apparatus 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the device 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply components 406 provide power to the various components of device 400. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power supplies for the apparatus 400.
The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 400 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, audio component 410 includes a Microphone (MIC) configured to receive external audio signals when apparatus 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the apparatus 400. For example, the sensor component 414 can detect the open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the apparatus 400, the sensor component 414 can also detect a change in the position of the apparatus 400 or a component of the apparatus 400, the presence or absence of user contact with the apparatus 400, orientation or acceleration/deceleration of the apparatus 400, and a change in the temperature of the apparatus 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the apparatus 400 and other devices. The apparatus 400 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the apparatus 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a memory optimization method, comprising:
when the first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (14)

1. A memory optimization method is applied to a mobile terminal, and is characterized by comprising the following steps:
when first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the running processes reaches or exceeds a preset process total number threshold value.
2. The method of claim 1, wherein determining the real-time priority of each of the running processes comprises:
and determining the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process, wherein the initial priority of each process is contained in the attribute information of the process, and the second information of each process at least comprises the size of the occupied memory space and/or the activity of the process.
3. The method of claim 2, wherein determining the real-time priority of each process based on the initial priority of each process in the running processes and the second information of each process comprises:
when the second information of each process comprises the size of the occupied memory space, comparing the size of the memory space occupied by each process in the running process with a second memory threshold value respectively;
when the size of the memory space occupied by the process is smaller than or equal to the second memory threshold, increasing the initial priority of the process to obtain the real-time priority of the process;
and when the size of the memory space occupied by the process is larger than the second memory threshold, reducing the initial priority of the process to obtain the real-time priority of the process.
4. The method of claim 2, wherein determining the real-time priority of each process based on the initial priority of each process in the running processes and the second information of each process comprises:
when the second information of each process comprises the process activity, comparing the process activity of each process in the running process with a preset first activity threshold value respectively;
and when the process activity of the process is smaller than the first activity threshold value, reducing the initial priority of the process to obtain the real-time priority of the process.
5. The method of claim 4, wherein the reducing the initial priority of the process to obtain the real-time priority of the process comprises:
sequencing all processes with process activity degrees smaller than the first activity degree threshold value according to the sequence of the process activity degrees from low to high;
and sequentially reducing the initial priority of each process according to the sequence to obtain the real-time priority of the process, wherein the reduced amplitude of the initial priority of each process in the sequence is inversely related to the position of the process in the sequence.
6. The method of claim 1, further comprising:
when the first information of the running process meets the preset condition, if the running process is determined to have a process with the process activity degree lower than a preset second activity degree threshold, closing the process with the process activity degree lower than the preset second activity degree threshold, wherein the second activity degree threshold is smaller than the first activity degree threshold.
7. A memory optimization device, comprising:
the system comprises a first module, a second module and a third module, wherein the first module is used for determining the real-time priority of each process in the running processes when first information of the running processes meets a preset condition, and the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
the second module is used for closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
8. The apparatus of claim 7, wherein the first module comprises:
and the priority calculating submodule is used for determining the real-time priority of each process according to the initial priority of each process in the running process and the second information of each process, wherein the initial priority of each process is contained in the attribute information of the process, and the second information of each process at least comprises the size of the occupied memory space and/or the activity of the process.
9. The apparatus of claim 8, wherein the priority computation submodule comprises:
the first comparison submodule is used for comparing the size of the memory space occupied by each process in the running process with a second memory threshold value when the second information of each process comprises the size of the occupied memory space;
the first adjusting submodule is used for increasing the initial priority of the process to obtain the real-time priority of the process when the size of the memory space occupied by the process is smaller than or equal to the second memory threshold;
and the second adjusting submodule is used for reducing the initial priority of the process to obtain the real-time priority of the process when the size of the memory space occupied by the process is larger than the second memory threshold value.
10. The apparatus of claim 8, wherein the priority computation submodule comprises:
the second comparison submodule is used for comparing the process activity of each process in the running process with a preset first activity threshold when the second information of each process comprises the process activity;
and the third adjusting submodule is used for reducing the initial priority of the process to obtain the real-time priority of the process when the process activity of the process is smaller than the first activity threshold value.
11. The apparatus of claim 10, wherein the third adjustment submodule comprises:
the sequencing submodule is used for sequencing all the processes with the process activity degrees smaller than the first activity degree threshold value according to the sequence of the process activity degrees from low to high;
and the determining submodule is used for sequentially reducing the initial priority of each process according to the sequence to obtain the real-time priority of the process, wherein the reduced amplitude of the initial priority of each process in the sequence is inversely related to the position of the process in the sequence.
12. The apparatus of claim 7, further comprising:
and the third module is used for closing the process with the process activity degree lower than the preset second activity degree threshold value if the process with the process activity degree lower than the preset second activity degree threshold value exists in the running process when the first information of the running process meets the preset condition, wherein the second activity degree threshold value is smaller than the first activity degree threshold value.
13. A memory optimization device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
14. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a terminal device, enable the terminal device to perform a memory optimization method, the method comprising:
when first information of the running processes meets a preset condition, determining the real-time priority of each process in the running processes, wherein the first information of the running processes at least comprises the size of a memory space occupied by the running processes and/or the total number of the processes of the running processes;
closing the process of which the real-time priority is lower than a preset priority threshold in the running process;
wherein the preset condition at least comprises any one of the following conditions:
the size of the memory space occupied by the running process reaches or exceeds a preset first memory threshold;
the total number of the processes of the running processes reaches or exceeds a preset threshold value of the total number of the processes.
CN202010442458.8A 2020-05-22 2020-05-22 Memory optimization method and device and computer storage medium Pending CN113722080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010442458.8A CN113722080A (en) 2020-05-22 2020-05-22 Memory optimization method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010442458.8A CN113722080A (en) 2020-05-22 2020-05-22 Memory optimization method and device and computer storage medium

Publications (1)

Publication Number Publication Date
CN113722080A true CN113722080A (en) 2021-11-30

Family

ID=78671335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010442458.8A Pending CN113722080A (en) 2020-05-22 2020-05-22 Memory optimization method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN113722080A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617529A (en) * 2022-11-17 2023-01-17 中国人民解放军国防科技大学 Process management method and device in mobile application compatible running environment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617529A (en) * 2022-11-17 2023-01-17 中国人民解放军国防科技大学 Process management method and device in mobile application compatible running environment

Similar Documents

Publication Publication Date Title
CN110166371B (en) Flow control method and device, electronic equipment and storage medium
EP3306441B1 (en) Temperature control method and apparatus
CN107193653B (en) Bandwidth resource allocation method, device and storage medium
CN107040591B (en) Method and device for controlling client
CN110262692B (en) Touch screen scanning method, device and medium
CN110087118B (en) Comment message processing method, comment message processing device, comment message processing terminal, comment message processing server and comment message processing medium
US20210191579A1 (en) Window adjustment method, window adjustment device and mobile terminal
CN111581174A (en) Resource management method and device based on distributed cluster system
US9678868B2 (en) Method and device for optimizing memory
CN112181265B (en) Touch signal processing method, device and medium
CN111880681A (en) Touch screen sampling rate adjusting method and device and computer storage medium
CN109062625B (en) Application program loading method and device and readable storage medium
CN111580980B (en) Memory management method and device
CN107436782B (en) Application silent installation method and device
CN107368175B (en) Processing method and device for reducing terminal power consumption and terminal
CN113722080A (en) Memory optimization method and device and computer storage medium
CN111506234B (en) Method and device for preventing false touch of edge of touch screen, storage medium and electronic equipment
CN109644353B (en) Configuration adjustment method, device, electronic equipment and computer readable storage medium
CN110837288B (en) Application management method and device, mobile terminal and readable storage medium
CN109922203B (en) Terminal, screen off method and device
CN112307229A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN112083841B (en) Information input method, device and storage medium
CN113778669A (en) System resource allocation method, system resource allocation device, and storage medium
CN116089025A (en) Processor frequency control method, device and storage medium
CN114442792A (en) Method and device for adjusting operating frequency of processor and storage medium

Legal Events

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