A memory management method, intelligent terminal and computer storage medium

By obtaining the free and running memory values ​​of system memory, determining the operating mode and calculating the expected memory values ​​of the system, the problem of insufficient memory management in the existing technology is solved, and more flexible and efficient memory management is achieved, which improves the user experience.

CN114625521BActive Publication Date: 2025-04-08SHENZHEN TCL NEW-TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011423851.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-08
Publication Date
2025-04-08
Estimated Expiration
2040-12-08

AI Technical Summary

Technical Problem

The memory management method in the prior art lacks flexibility and cannot effectively deal with the problems of lag and duplicate loading when memory usage is high.

Method used

By obtaining the free and running memory values ​​of system memory, determine the current running mode of memory, and calculate the expected memory value of the system based on different modes, so as to flexibly manage the foreground and background applications and adjust memory usage.

Benefits of technology

It improves the flexibility of system memory management, reduces lag and duplicate loading when memory is insufficient, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625521B_ABST
    Figure CN114625521B_ABST
Patent Text Reader

Abstract

The present invention discloses a memory management method, an intelligent terminal and a computer storage medium, the method comprising: obtaining a system idle memory value and a system running memory value of a system memory; determining an operating mode corresponding to the system memory according to the system running memory value and the system idle memory value; and determining a system expected memory value corresponding to the system memory according to the operating mode. The present invention determines different system expected memory values ​​through operating modes, thereby achieving flexibility in opening or closing subsequent applications and improving the flexibility of memory management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a memory management method, an intelligent terminal and a computer storage medium. Background Art

[0002] Memory is one of the important components of the terminal. All programs run in memory, and external memory communicates with the CPU through memory to complete various tasks. As the terminal is used, more and more processes are started, and the memory usage rate is getting higher and higher. When the memory usage rate reaches a certain level, the memory will not respond in time to multiple processes, resulting in freezes, repeated loading, etc.

[0003] The main response method currently used is to forcibly stop some running processes to ensure free memory capacity when the free memory capacity is insufficient. However, this method of ensuring free memory only considers the value of running memory and terminates the running process by setting a memory threshold, without considering the running status of the application, which lacks flexibility. Usually, memory adjustment is only performed when the memory usage rate is very high, and often a critical point appears, which greatly reduces the user experience. Summary of the invention

[0004] The main purpose of the present invention is to provide a memory management method, an intelligent terminal and a computer storage medium, aiming to solve the problem of lack of flexibility of memory management methods in the prior art.

[0005] To achieve the above object, the present invention provides a memory management method, which comprises the following steps:

[0006] Get the system free memory value and system running memory value of the system memory;

[0007] Determining an operation mode corresponding to the system memory according to the system operation memory value and the system free memory value;

[0008] According to the operating mode, a system expected memory value corresponding to the system memory is determined.

[0009] Optionally, the memory management method, wherein the step of determining the operating mode corresponding to the system memory according to the system operating memory value and the system free memory value, specifically includes:

[0010] The operation mode corresponding to the system memory is determined according to the size between the memory ratio and a preset mode memory ratio threshold, wherein the memory ratio is the ratio of the system free memory value to the system operation memory value.

[0011] Optionally, in the memory management method, the mode memory ratio threshold includes a safe memory ratio threshold, a recommended memory ratio threshold and a limit memory ratio threshold, and determining the operating mode corresponding to the system memory according to the size between the memory ratio and the preset mode memory ratio threshold specifically includes:

[0012] When the memory ratio is less than or equal to the safe memory ratio threshold, determining that the operating mode corresponding to the system memory is a safe mode;

[0013] When the memory ratio is greater than the safe memory ratio threshold and less than or equal to the recommended memory ratio threshold, determining that the operating mode corresponding to the system memory is the recommended mode;

[0014] When the memory ratio is greater than the recommended memory ratio threshold and less than or equal to the limit memory ratio threshold, determining that the operation mode corresponding to the system memory is the limit mode;

[0015] When the memory ratio is greater than the limit memory ratio threshold, it is determined that the operation mode corresponding to the system memory is a disabled mode.

[0016] Optionally, in the memory management method, the step of determining, according to the operating mode, a system expected memory value corresponding to the system memory specifically includes:

[0017] Determining an expected memory operation ratio corresponding to the system memory according to the operation mode;

[0018] The product of the expected memory operation ratio and the total memory value of the system memory is calculated to obtain a system expected memory value corresponding to the system memory.

[0019] Optionally, the memory management method, after determining the system expected memory value corresponding to the system memory according to the operation mode, further comprises:

[0020] According to the system expected memory value, currently running foreground applications and background applications are managed.

[0021] Optionally, in the memory management method, the system running memory value includes a background running memory value and a foreground running memory value, wherein the foreground running memory value includes a foreground application memory value corresponding to each foreground application, and the background running memory value includes a background application memory value corresponding to each background application;

[0022] The system expected memory value includes a foreground expected memory value and a background expected memory value.

[0023] Optionally, the memory management method, wherein the managing of currently running foreground applications and background applications according to the system expected memory value, specifically includes:

[0024] Determine a foreground target application in each of the foreground applications according to the foreground application memory values ​​respectively corresponding to each of the foreground applications in the foreground running memory value, and convert the foreground target application into a background application;

[0025] According to the background application memory values ​​respectively corresponding to the background applications in the background running memory values, a background target application in each of the background applications is determined, and the running of the background target application is terminated.

[0026] Optionally, the memory management method, wherein determining the foreground target application in each foreground application according to the foreground application memory value corresponding to each foreground application in the foreground running memory value, specifically includes:

[0027] Sort the foreground applications according to the usage frequencies corresponding to the foreground applications, and generate a foreground application table;

[0028] The foreground target application in the foreground application table is determined according to the foreground application running values ​​and the foreground expected memory values ​​respectively corresponding to the foreground applications.

[0029] In addition, to achieve the above-mentioned purpose, the present invention also provides an intelligent terminal, wherein the intelligent terminal includes: a memory, a processor, and a memory management program stored in the memory and executable on the processor, and when the memory management program is executed by the processor, the steps of the memory management method described above are implemented.

[0030] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, wherein the computer storage medium stores a memory management program, and when the memory management program is executed by a processor, the steps of the memory management method described above are implemented.

[0031] The present invention provides a memory management method, an intelligent terminal and a computer storage medium, which first obtains a system idle memory value and a system running memory value in a system memory, and then determines an operation mode corresponding to the current system memory according to the system idle memory value and the system running memory value. Different operation modes correspond to different system expected memory values ​​or different calculation methods of the system expected memory value. Therefore, according to the operation mode, the size of the system expected memory value corresponding to the system memory in different states can be determined. Subsequently, the applications running in the system can be managed according to the size of the system expected memory value, thereby making the system memory management more flexible. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of a preferred embodiment of the memory management method provided by the present invention;

[0033] Figure 2 This is a specific flow chart of step S300 in a preferred embodiment of the memory management method of the present invention;

[0034] Figure 3 It is a flow chart of determining the expected memory value of the system in a preferred embodiment of the memory management method provided by the present invention;

[0035] Figure 4 Schematic diagram of the operating environment of a preferred embodiment of the intelligent terminal of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0037] The memory management method described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the memory management method comprises the following steps:

[0038] Step S100, obtaining a system free memory value and a system running memory value of the system memory.

[0039] In this embodiment, the program for executing the memory management method is installed on the smart terminal. When the user starts the smart terminal, the program is automatically started or started by the user. After starting, the program monitors the smart terminal and obtains the memory usage data in the smart terminal in real time or periodically. The memory usage data includes the system free memory value, that is, the value of the system memory that has not been used; and the system running memory value, that is, the value of the system memory that has been used by the foreground application or the background application.

[0040] Step S200: determining an operation mode corresponding to the system memory according to the system operation memory value and the system free memory value.

[0041] Specifically, based on the system running memory value and the system free memory value, the program can determine the current system memory running state. For example, if the system free memory value is only 10%, it means that the current system memory is in a tight state of use. Preset multiple running modes to describe the state of the system memory. For example, three running modes are preset, one for the dangerous mode, the middle mode and the safe mode. Determine the type of running mode that the current system memory is in based on the size or ratio of the system running memory value and the system free memory value.

[0042] Furthermore, in this embodiment, the mode type is preferably determined based on the ratio of the two, and the specific process is as follows:

[0043] A10, determining the operating mode corresponding to the system memory according to the size between the memory ratio and a preset mode memory ratio threshold, wherein the memory ratio is the ratio of the system free memory value to the system operating memory value.

[0044] Specifically, after obtaining the system running memory value and the system free memory value, the ratio between the two is calculated. For example, if the total memory value of the system memory is 8G, the system running memory value is 6G, and the system free memory value is 2G, then the ratio between the two is 1: 3. A corresponding mode memory ratio threshold is set for each operating mode in advance, and then the calculated memory ratio is compared with the mode memory ratio threshold to determine the operating mode corresponding to the system memory.

[0045] Furthermore, the mode memory ratio threshold includes a safe memory ratio threshold, a recommended memory ratio threshold and a limit memory ratio threshold, wherein the safe memory ratio threshold is smaller than the recommended memory ratio threshold, and the recommended memory ratio threshold is smaller than the limit memory ratio threshold; the operating mode includes a safe mode, a recommended mode, a limit mode and a disabled mode.

[0046] Step A10 includes:

[0047] Step A11: when the memory ratio is less than or equal to the secure memory ratio threshold, determine that the operating mode corresponding to the system memory is the secure mode.

[0048] Specifically, in this embodiment, four operation modes and three mode memory ratio thresholds are adopted. The safe mode means that there are fewer processes running in the current system memory, so it is relatively safe, and the foreground application and the background application may not be adjusted or slightly adjusted later. The recommended mode means that the processes running in the current system memory are moderate, and the foreground application or the background application may not be adjusted or slightly adjusted later. The extreme mode means that there are more processes running in the current system memory, and the foreground application and the background application need to be adjusted significantly. The disabled mode means that the usage rate of the current system memory is already very high, so the foreground application and the background application need to be adjusted significantly.

[0049] The implementation process is described by taking the safe memory ratio threshold, the recommended memory ratio threshold, and the limit memory ratio threshold as 1:4, 2:4, and 3:4, respectively. After the memory ratio is calculated, the obtained memory ratio is compared with the three mode memory ratio thresholds. When the memory ratio is less than or equal to the safe memory ratio threshold, for example, the memory ratio is 1:5, it means that there are fewer applications running in the foreground and the background, and the memory occupied is also less, and it is not yet determined that the operating mode corresponding to the current system memory is the safe mode.

[0050] Step A12: When the memory ratio is greater than the safe memory ratio threshold and less than or equal to the recommended memory ratio threshold, determine that the operating mode corresponding to the system memory is the recommended mode.

[0051] Specifically, when the memory ratio is greater than the safe memory ratio threshold and less than or equal to the recommended memory ratio threshold, for example, the memory ratio is 2:5, it means that the current system memory usage is medium, so the corresponding operating mode is determined to be the recommended mode.

[0052] Step A13: When the memory ratio is greater than the recommended memory ratio threshold and less than or equal to the limit memory ratio threshold, determine that the operating mode corresponding to the system memory is the limit mode.

[0053] Specifically, when the memory ratio is greater than the recommended memory ratio threshold and less than or equal to the limit memory ratio threshold, for example, the memory ratio is 3:5, it means that the current system memory usage is high, so the corresponding operating mode is determined to be the limit mode.

[0054] Step A14: when the memory ratio is greater than the limit memory ratio threshold, determine that the operation mode corresponding to the system memory is a disabled mode.

[0055] Specifically, when the memory ratio is greater than the limit memory ratio threshold, for example, the memory ratio is 4:5, it means that the current system memory usage is very high, so the corresponding operating mode is determined to be the disabled mode.

[0056] Step S300: determining a system expected memory value corresponding to the system memory according to the operation mode.

[0057] Specifically, once the operating mode corresponding to the system memory is determined, the current usage status of the system memory is also determined. Therefore, according to different operating modes, the foreground applications and background applications are managed, and some of the applications are terminated to achieve the effect of freeing up part of the memory. In the first implementation method of the present embodiment, the foreground applications and background applications are sorted according to the last usage time corresponding to each foreground application and background application, and the application whose last usage time is closest to the current time is ranked first, and the application whose last usage time is farthest from the current time is ranked last. After the operating mode is determined, the application is terminated from the back to the front until the corresponding operating mode is determined to be the recommended mode or the safe mode according to the memory ratio corresponding to the system memory. In the second implementation method of the present embodiment, a memory threshold is set for each operating mode. When the operating mode is determined, the foreground application or background application is terminated according to the memory threshold corresponding to each operating mode, thereby achieving the effect of clearing the memory. In the second implementation method, refer to Figure 2 and Figure 3 , step S300 includes:

[0058] Step S310: determining an expected memory operation ratio corresponding to the system memory according to the operation mode.

[0059] Specifically, an operation parameter file is saved in advance for each operation mode, and the memory threshold corresponding to the operation mode is recorded in the operation parameter file. As shown in the following table, this embodiment takes the operation parameter file in the Extensible Markup Language (XML) format as an example to describe the content of the operation parameter file:

[0060]

[0061]

[0062] The program pre-stores five XML files, which are used to record the system expected memory values ​​corresponding to safe mode, recommended mode, extreme mode and disabled mode. The system expected memory value can be a specific expected memory value, such as 6G, 5G, or the expected memory operation ratio as shown in the table.

[0063] The expected memory operation ratio can be set according to the total memory value of the system memory, so it is more flexible than a fixed expected memory value. As shown in the above table, the data type saved in different operating modes is a string. For example, if the operating mode is a safe mode, the corresponding expected memory operation ratio can be 4%, 5%, 6%, 7%, 8% and 10%. In this embodiment, in the XML file, except for the disabled mode, the other three operating modes correspond to six expected memory operation ratios. Users can choose what they need from these six expected memory operation ratios before or during the program runs, but generally during the running process, the expected memory operation ratios corresponding to the safe mode, recommended mode, and extreme mode gradually increase.

[0064] Step S320, calculating the product of the expected memory operation ratio and the total memory value of the system memory to obtain the system expected memory value corresponding to the system memory.

[0065] Specifically, the expected memory operation ratio is multiplied by the total memory value of the system memory. For example, if the total memory value of the system memory is 8 GB and the expected memory operation ratio is 20%, the final system expected memory value is 1.6 GB.

[0066] In addition, in the operation parameter file corresponding to the disabled mode, the corresponding expected memory operation ratio is not set. Since the terminal generally has a relatively simple memory management function, a memory value is set as the system default value. When it exceeds this system default value, memory management is performed. In order to ensure that the application can run normally in most cases, this system default value is generally set to a relatively high value, such as 60%. Therefore, the disabled mode in this implementation directly uses this system default value as its corresponding system expected memory value. However, this is not fixed, and the disabled mode can also adopt similar settings as other modes.

[0067] The program can also set operating mode identifiers to represent various operating modes. As shown in the last row of the above table, the operating mode identifier corresponding to the safe mode is 1. Therefore, when the operating mode identifier is 1, it can be determined that the operating mode corresponding to the system memory is the safe mode. Therefore, the operating parameter file corresponding to the safe mode is obtained to obtain the system expected memory value therein.

[0068] Further, after determining the expected system memory value, the running applications can be managed and cleaned up according to the expected system memory value, so as to ensure the normal operation of the system, so after step S320, the following is also included:

[0069] Step S400: managing currently running foreground applications and background applications according to the system expected memory value.

[0070] Specifically, the foreground application refers to the application currently running in the foreground of the terminal; the background application refers to the application currently running in the background of the terminal. The system expected memory value is the memory value to which the program hopes the system running memory value in the system memory will drop in the future. Therefore, after obtaining the system expected memory value, the system expected memory value can be used as the memory threshold in the conventional memory management to close the foreground application and the background application.

[0071] For example, the above-mentioned system expected memory value is 1.6G, and the system running memory value at this time is 3G. According to the difference between the system running memory value and the system expected memory value, some applications in the background applications and foreground applications are terminated, thereby realizing the management of the foreground applications and background applications. In the first implementation method provided by this embodiment, the termination method is to sort the foreground applications and background applications according to the last time they were used. The greater the time difference between the time of use and the current time, the later the sorting is. The background applications are terminated from the back to the front first, and then the foreground applications are terminated from the back to the front, until the system running memory value of the current system is less than or equal to the system expected memory value.

[0072] In a second implementation of this embodiment, the system running memory value includes a background running memory value and a foreground running memory value, wherein the foreground running memory value includes the foreground application memory value corresponding to each foreground application, and the background running memory value includes the background application memory value corresponding to each background application; the system expected memory value includes the foreground expected memory value and the background expected memory value.

[0073] Step S400 includes:

[0074] Step S410, determining a foreground target application in each of the foreground applications according to the foreground application memory values ​​respectively corresponding to each of the foreground applications in the foreground running memory value, and converting the foreground target application into a background application.

[0075] Specifically, the system running memory value includes the foreground running memory value and the background running memory value. The foreground running memory value includes the foreground application memory value corresponding to each foreground application, and the background running memory value includes the background application memory value corresponding to each background application. The system expected memory value includes the foreground expected memory value and the background expected memory value. A method similar to the above-mentioned termination of operation according to the time of use can be adopted. First, the foreground applications are sorted according to the time of use, and then the foreground target application is determined from back to front according to the foreground expected memory value and the foreground running memory value. Then the foreground target application is transferred from foreground operation to background operation, that is, the foreground target application is transferred to a background application. Compared with the foreground operation, the background operation can provide some lightweight operation services, such as issuing notifications, so it occupies less memory, and after switching to background operation, the application is not completely terminated, and the user can restart it faster.

[0076] Furthermore, if a foreground application that is frequently used by the user is transferred to the background, the user is more likely to wake up the foreground application later, which will also affect the user's experience. Therefore, in order to reduce the frequency of subsequent re-awakening of background application events, in this embodiment, a method for determining the foreground target application based on the user's usage frequency is provided, specifically:

[0077] Sort the foreground applications according to the usage frequencies corresponding to the foreground applications, and generate a foreground application table;

[0078] The foreground target application in the foreground application table is determined according to the foreground application memory values ​​and the foreground expected memory values ​​respectively corresponding to the foreground applications.

[0079] Specifically, the usage frequency refers to the number of times each foreground application is used within a certain monitoring period. According to the usage frequency, each foreground application is sorted to generate a foreground application table. Then, according to the foreground application memory value and the premise expected memory value, the foreground target application in the foreground application table is determined in the order of usage frequency from small to large. If there are multiple foreground applications with the same corresponding usage frequency, according to the size of the foreground application memory value, the foreground application with the larger foreground application memory value is first determined as the foreground target application.

[0080] Step S420, determining the background target application in each of the background operations according to the background application memory values ​​respectively corresponding to the background applications in the background operation memory values, and terminating the operation of the background target application.

[0081] Specifically, in the process of performing background target applications, a method similar to the above method of determining the foreground target application may be adopted, and the background running memory value includes the background application memory value corresponding to each background application. Specifically as follows:

[0082] Sort the background applications according to the wake-up frequencies corresponding to the background applications, and generate a background application table;

[0083] According to the background application values ​​and the background expected memory values ​​respectively corresponding to the background applications, the background target application in the background application table is determined, and the background application is terminated.

[0084] Most background applications work in the background and will only run in the foreground after being woken up by the user. When running in the foreground, the frequency of use can be used to determine whether the application is frequently used by the user, while the wake-up frequency is used as the measurement standard for background applications. In addition, the wake-up frequency corresponding to the background applications is zero, which means that the background applications have always been in the background and have never been woken up by the user. This means that these background applications are most likely applications that are not frequently used by the user. Therefore, the wake-up frequency corresponding to the background applications can be sorted to generate a background application table, and then the background applications can be terminated one by one according to the corresponding acquired application memory values ​​of each background application. The operation of the background application can be terminated by obtaining the name of the background target application and the corresponding process number, and then closing the background target application according to the name and process number, and exiting all related processes.

[0085] Furthermore, if Figure 4 As shown, based on the above memory management method, the present invention also provides a smart terminal accordingly, and the smart terminal includes: a processor 10, a memory 20 and a display 30. Figure 4 Only some components of the smart terminal are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.

[0086] In some embodiments, the memory 20 may be an internal storage unit of the smart terminal, such as a hard disk or memory of the smart terminal. In other embodiments, the memory 20 may also be an external storage device of the smart terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the smart terminal. Further, the memory 20 may also include both an internal storage unit of the smart terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the smart terminal, such as the program code of the installed smart terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a memory management program 40 is stored on the memory 20, and the memory management program 40 can be executed by the processor 10, thereby implementing the memory management method in the present application.

[0087] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the memory management method.

[0088] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the smart terminal and to display a visual user interface. The components 10-30 of the smart terminal communicate with each other via a system bus.

[0089] In one embodiment, when the processor 10 executes the memory management program 40 in the memory 20, the following steps are implemented:

[0090] Get the system free memory value and system running memory value of the system memory;

[0091] Determining an operation mode corresponding to the system memory according to the system operation memory value and the system free memory value;

[0092] According to the operating mode, a system expected memory value corresponding to the system memory is determined.

[0093] The step of determining the operating mode corresponding to the system memory according to the system operating memory value and the system free memory value specifically includes:

[0094] The operation mode corresponding to the system memory is determined according to the size between the memory ratio and a preset mode memory ratio threshold, wherein the memory ratio is the ratio of the system free memory value to the system operation memory value.

[0095] The mode memory ratio threshold includes a safe memory ratio threshold, a recommended memory ratio threshold and a limit memory ratio threshold, and the operation mode corresponding to the system memory is determined according to the size between the memory ratio and the preset mode memory ratio threshold, specifically including:

[0096] When the memory ratio is less than or equal to the safe memory ratio threshold, determining that the operating mode corresponding to the system memory is a safe mode;

[0097] When the memory ratio is greater than the safe memory ratio threshold and less than or equal to the recommended memory ratio threshold, determining that the operating mode corresponding to the system memory is the recommended mode;

[0098] When the memory ratio is greater than the recommended memory ratio threshold and less than or equal to the limit memory ratio threshold, determining that the operating mode corresponding to the system memory is the limit mode;

[0099] When the memory ratio is greater than the limit memory ratio threshold, it is determined that the operation mode corresponding to the system memory is a disabled mode.

[0100] The step of determining the system expected memory value corresponding to the system memory according to the operation mode specifically includes:

[0101] Determining an expected memory operation ratio corresponding to the system memory according to the operation mode;

[0102] The product of the expected memory operation ratio and the total memory value of the system memory is calculated to obtain a system expected memory value corresponding to the system memory.

[0103] Wherein, after determining the system expected memory value corresponding to the system memory according to the operation mode, the method further includes:

[0104] According to the system expected memory value, currently running foreground applications and background applications are managed.

[0105] The system running memory value includes a background running memory value and a foreground running memory value, wherein the foreground running memory value includes a foreground application memory value corresponding to each foreground application, and the background running memory value includes a background application memory value corresponding to each background application;

[0106] The system expected memory value includes a foreground expected memory value and a background expected memory value.

[0107] The managing of currently running foreground applications and background applications according to the expected memory value of the system specifically includes:

[0108] Determine a foreground target application in each of the foreground applications according to the foreground application memory values ​​respectively corresponding to each of the foreground applications in the foreground running memory value, and convert the foreground target application into a background application;

[0109] According to the background application memory values ​​respectively corresponding to the background applications in the background running memory values, a background target application in each of the background applications is determined, and the running of the background target application is terminated.

[0110] The determining of the foreground target application in each of the foreground applications according to the foreground application memory values ​​respectively corresponding to the foreground applications in the foreground running memory values ​​specifically includes:

[0111] Sort the foreground applications according to the usage frequencies corresponding to the foreground applications, and generate a foreground application table;

[0112] The foreground target application in the foreground application table is determined according to the foreground application running values ​​and the foreground expected memory values ​​respectively corresponding to the foreground applications.

[0113] The present invention also provides a computer storage medium, wherein the computer storage medium stores a memory management program, and when the memory management program is executed by a processor, the steps of the memory management method described above are implemented.

[0114] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable computer storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The computer storage medium can be a memory, a disk, an optical disk, etc.

[0115] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A memory management method, characterized in that: The memory management method comprises: Get the system free memory value and system running memory value of the system memory; Determining the operating mode corresponding to the system memory according to the system operating memory value and the system free memory value; Determining the operating mode corresponding to the system memory according to the system operating memory value and the system free memory value specifically includes: determining the operating mode corresponding to the system memory according to the size between a memory ratio and a preset mode memory ratio threshold, wherein the memory ratio is a ratio of the system free memory value to the system operating memory value; The mode memory ratio threshold includes a safe memory ratio threshold, a recommended memory ratio threshold and a limit memory ratio threshold. The operation mode corresponding to the system memory is determined according to the size between the memory ratio and the preset mode memory ratio threshold, specifically including: When the memory ratio is less than or equal to the safe memory ratio threshold, determining that the operating mode corresponding to the system memory is a safe mode; When the memory ratio is greater than the safe memory ratio threshold and less than or equal to the recommended memory ratio threshold, determining that the operating mode corresponding to the system memory is the recommended mode; When the memory ratio is greater than the recommended memory ratio threshold and less than or equal to the limit memory ratio threshold, determining that the operation mode corresponding to the system memory is the limit mode; When the memory ratio is greater than the limit memory ratio threshold, determining that the operation mode corresponding to the system memory is a disabled mode; According to the operation mode, the system expected memory value corresponding to the system memory is determined; the user selects the expected memory operation ratio before or during the program operation, and the system expected memory value is obtained according to the product of the set expected memory operation ratio and the total memory value of the system memory; according to different operation modes, the applications are managed and some of the applications are terminated to achieve the effect of freeing up part of the memory: wherein, according to the system expected memory value, the currently running foreground applications and background applications are managed; the foreground operation memory value includes the foreground application memory value corresponding to each foreground application, and the background operation memory value includes the background application memory value corresponding to each background application; the system expected memory value includes the foreground expected memory value and the background expected memory value; Determine a foreground target application in each of the foreground applications according to the foreground application memory values ​​respectively corresponding to each of the foreground applications in the foreground running memory value, and convert the foreground target application into a background application; According to the background application memory values ​​respectively corresponding to the background applications in the background running memory values, a background target application in each of the background applications is determined, and the running of the background target application is terminated.

2. The memory management method according to claim 1, characterized in that: Determining, according to the operating mode, a system expected memory value corresponding to the system memory specifically includes: Determining an expected memory operation ratio corresponding to the system memory according to the operation mode; The product of the expected memory operation ratio and the total memory value of the system memory is calculated to obtain a system expected memory value corresponding to the system memory.

3. The memory management method according to claim 1, characterized in that: The determining, according to the foreground application memory values ​​respectively corresponding to the foreground applications in the foreground running memory values, a foreground target application in each foreground application specifically includes: Sort the foreground applications according to the usage frequencies corresponding to the foreground applications, and generate a foreground application table; The foreground target application in the foreground application table is determined according to the foreground application memory values ​​and the foreground expected memory values ​​respectively corresponding to the foreground applications.

4. An intelligent terminal, characterized in that: The intelligent terminal comprises: A memory, a processor, and a memory management program stored in the memory and executable on the processor, wherein the memory management program, when executed by the processor, implements the steps of the memory management method according to any one of claims 1 to 3.

5. A computer storage medium, characterized in that: The computer storage medium stores a memory management program, and when the memory management program is executed by a processor, the steps of the memory management method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Resource configuration method, terminal and computer readable storage medium

    CN108664329A

  • Memory recovery method, device, electronic equipment and computer readable storage medium

    CN111966492A