CN118394600A - Memory management control method, device, equipment, storage medium and product - Google Patents
Memory management control method, device, equipment, storage medium and product Download PDFInfo
- Publication number
- CN118394600A CN118394600A CN202410563039.8A CN202410563039A CN118394600A CN 118394600 A CN118394600 A CN 118394600A CN 202410563039 A CN202410563039 A CN 202410563039A CN 118394600 A CN118394600 A CN 118394600A
- Authority
- CN
- China
- Prior art keywords
- memory
- terminal system
- killing
- application program
- management control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 128
- 230000008569 process Effects 0.000 claims description 71
- 238000001514 detection method Methods 0.000 claims description 19
- 230000008859 change Effects 0.000 claims description 8
- 238000012216 screening Methods 0.000 claims description 3
- 238000004590 computer program Methods 0.000 claims description 2
- 238000007689 inspection Methods 0.000 abstract description 8
- 238000007726 management method Methods 0.000 description 59
- 230000000694 effects Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007639 printing Methods 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The application discloses a memory management control method, a device, equipment, a storage medium and a product, and relates to the technical field of memory management, wherein the method comprises the following steps: when detecting that an application program is accessed into a terminal system, checking the memory of the terminal system; if the terminal system passes the memory check, acquiring configuration information of the application program from a preset configuration file corresponding to the terminal system; when the current occupied memory ratio of the terminal system exceeds a preset threshold, judging whether to search and kill the application program according to the configuration information. Compared with the traditional memory management control method, the method acquires the configuration information of the related application program from the terminal system passing through the memory inspection, and searches and kills the application program according to the configuration information when the memory of the terminal system is relatively high, so that more memory is provided for the newly started application program, and the technical problem that the memory of the terminal system is excessively high when the terminal system faces to the running scene of a plurality of application programs is solved.
Description
Technical Field
The present application relates to the field of memory management technologies, and in particular, to a memory management control method, device, apparatus, storage medium, and product.
Background
With the higher and higher configuration of automobiles, more and more application programs are supported to run in the terminals of the automobiles, and the functions and the complexity of the on-board central control system are also improved continuously, so that the system needs more memory to support the running of various application programs and services.
However, when the vehicle is faced with a scenario in which a plurality of application programs are running, the vehicle-mounted central control system needs to process a large amount of real-time data and vehicle state information, which results in the problems that the memory occupation of the terminal system is too high to run a new application program, or the new application program is blocked and unresponsive when running.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present application and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The application mainly aims to provide a memory management control method, a device, equipment, a storage medium and a product, and aims to solve the technical problem that the memory occupation of a terminal system is too high when facing a scene of running a plurality of application programs in the prior art.
In order to achieve the above object, the present application provides a memory management control method, which includes the following steps:
When detecting that an application program is accessed into a terminal system, performing memory check on the terminal system;
If the terminal system passes the memory check, acquiring configuration information of the application program from a preset configuration file corresponding to the terminal system;
and when the current occupied memory ratio of the terminal system exceeds a preset threshold, judging whether to search and kill the application program according to the configuration information.
In one embodiment, the step of performing memory check on the terminal system when detecting that the terminal system accesses the application program includes:
when a terminal system reaches a preset detection triggering condition, detecting the terminal system, wherein the preset detection triggering condition comprises a timing triggering condition, a triggering condition after process state change and a triggering condition after task stack change;
and when the access application program in the terminal system is detected, checking the total memory and the available memory of the terminal system.
In an embodiment, after the step of obtaining the configuration information of the application program from the preset configuration file corresponding to the terminal system if the terminal system passes the memory check, the method further includes:
If the total memory of the terminal system is in the first numerical value interval or the available memory duty ratio of the terminal system is in the second numerical value interval, judging that the terminal system does not pass the memory check, and outputting an error log.
In an embodiment, the step of determining whether to kill the application program according to the configuration information includes:
Screening application programs belonging to background processes in the terminal system at the current moment from the application programs to obtain application programs capable of being checked and killed;
And determining the killing priority of the application programs capable of killing according to the configuration information, and killing the application programs capable of killing based on the killing priority.
In an embodiment, the step of determining the killing priority of the application program according to the configuration information and killing the application program based on the killing priority includes:
determining a state value of the searchable application according to a preset process state definition table, and determining an initial searching and killing priority of the searchable application based on the state value;
And adjusting the initial killing priority according to the configuration information to obtain an adjusted killing priority, and killing the application programs capable of killing based on the adjusted killing priority.
In an embodiment, after the step of determining whether to kill the application program according to the configuration information when the currently used memory duty ratio of the terminal system exceeds a preset threshold, the method further includes:
If the application program is detected to be checked and killed, storing log information corresponding to the checking and killing to a database, and updating the current used memory duty ratio of the terminal system;
and if the updated currently used memory duty ratio does not exceed the preset threshold value, ending the checking and killing task.
In addition, in order to achieve the above object, the present application also provides a memory management control device, including:
The memory checking module is used for checking the memory of the terminal system when detecting that the terminal system is accessed to the application program;
the information acquisition module is used for acquiring the configuration information of the application program from a preset configuration file corresponding to the terminal system if the terminal system passes the memory check;
And the process checking and killing module is used for judging whether to check and kill the application program according to the configuration information when the current occupied memory ratio of the terminal system exceeds a preset threshold value.
In addition, in order to achieve the above object, the present application also proposes a memory management control device, the device comprising: a memory, a processor, and a memory management control program stored on the memory and executable on the processor, the memory management control program configured to implement the steps of the memory management control method as described above.
In addition, in order to achieve the above object, the present application also proposes a storage medium, which is a computer-readable storage medium, and on which a memory management control program is stored, the memory management control program implementing the steps of the memory management control method as described above when executed by a processor.
In addition, to achieve the above object, the present invention also provides a computer program product comprising a memory management control program which, when executed by a processor, implements the steps of the memory management control method as described above.
When detecting that an application program is accessed into a terminal system, the application performs memory inspection on the terminal system; if the terminal system passes the memory check, acquiring configuration information of the application program from a preset configuration file corresponding to the terminal system; and when the current occupied memory ratio of the terminal system exceeds a preset threshold, judging whether to search and kill the application program according to the configuration information. Compared with the traditional memory management control method, the method acquires the configuration information of the related application program from the terminal system passing through the memory inspection, and searches and kills the application program according to the configuration information when the memory of the terminal system is relatively high, so that more memory is provided for the newly started application program, and the technical problem that the memory of the terminal system is excessively high when the terminal system faces to the running scene of a plurality of application programs is solved.
Drawings
FIG. 1 is a schematic diagram of a memory management control device in a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a memory management control method according to a first embodiment of the present application;
FIG. 3 is a diagram illustrating a BgAppManager architecture of a memory management control method according to the present application;
FIG. 4 is a flowchart illustrating a memory management control method according to a second embodiment of the present application;
FIG. 5 is a flowchart illustrating a memory management control method according to a third embodiment of the present application;
Fig. 6 is a block diagram illustrating a first embodiment of a memory management control device according to the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Referring to fig. 1, fig. 1 is a schematic diagram of a memory management control device of a hardware running environment according to an embodiment of the present application.
As shown in fig. 1, the memory management control device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is not limiting of the memory management control device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a memory management control program may be included in the memory 1005 as one type of storage medium.
In the memory management control device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the memory management control device of the present application may be disposed in the memory management control device, where the memory management control device invokes a memory management control program stored in the memory 1005 through the processor 1001, and executes the memory management control method provided by the embodiment of the present application.
An embodiment of the present application provides a memory management control method, referring to fig. 2, fig. 2 is a flow chart of a first embodiment of the memory management control method of the present application.
In this embodiment, the memory management control method includes the following steps:
Step S10: and when detecting that the terminal system is accessed to the application program, performing memory check on the terminal system.
It should be noted that, the execution body of the method of this embodiment may be a terminal device having functions of memory management, data processing, and program running, for example, a smart phone, a computer, etc., or may be an electronic device having the same or similar functions, for example, the memory management control device described above. The present embodiment and the following embodiments will be described below with reference to a memory management control device (hereinafter referred to as a control device).
It can be understood that the terminal system may be a vehicle terminal system, or may be a mobile phone terminal system, a tablet computer terminal system, or the like, which is not limited in this embodiment.
In a specific implementation, the memory check may be performed on the terminal system through ACTIVITYMANAGERSERVICE (AMS). AMS is an important system service in the Android system and is responsible for managing the lifecycle, task stack and processes of application programs. The Android system comprises a core framework component, a series of API (application program interface) supply application programs and other system components, wherein the core framework component belongs to the Android system, and the API supply application programs and the other system components are used for achieving the functions of interaction among application programs, multi-task management, resource allocation, authority control and the like. ACTIVITYMANAGERSERVICE, through interaction with the application programs and other system components, cooperation and resource management among the application programs in the Android system are realized. For example, when a user launches an application, ACTIVITYMANAGERSERVICE is responsible for launching the application's process and managing the application's activity and task stacks. Meanwhile, ACTIVITYMANAGERSERVICE is also responsible for monitoring the use condition of system resources so as to ensure the stable operation of the system.
Step S20: and if the terminal system passes the memory check, acquiring the configuration information of the application program from a preset configuration file corresponding to the terminal system.
It should be noted that the preset configuration file may be a JSON configuration table. A JSON configuration table is a configuration file or data table written using JSON (JavaScript Object Notation, JS object profile) format for storing and organizing various configuration information, data structures, or resources. It is commonly used in applications, websites, or systems, as a simple and flexible configuration file format, easy to write, read, and parse. JSON configuration tables are typically used to store configuration information for applications such as database connection information, server addresses, user preference settings, etc. By using JSON configuration tables, configuration information and data can be separated from code, making the application easier to maintain and expand.
In a specific implementation, the query may be performed in the JSON configuration table according to the process name of the application, so as to obtain configuration information corresponding to the application.
Step S30: and when the current occupied memory ratio of the terminal system exceeds a preset threshold, judging whether to search and kill the application program according to the configuration information.
It should be noted that, the above-mentioned preset threshold may be customized by the user, for example, 70%, 80%, 90%, etc., which is not limited in this embodiment.
It should be understood that when the currently used memory duty ratio of the terminal system exceeds the preset threshold, it may indicate that the memory of the terminal system is in a high occupied state at this time, and if the application program is not checked and killed, a newly started application program may not be run, or problems such as blocking and unresponsiveness may occur when the newly started application program is run.
In a specific implementation, the importance degrees of the applications in the terminal system can be confirmed according to the configuration information, and then whether to search and kill the applications is judged based on the importance degrees of the applications. Referring to fig. 3, fig. 3 is a schematic diagram illustrating a BgAppManager architecture of the memory management control method according to the present application. BgAppManager is a framework for controlling the operation of the device in this embodiment, and is used to manage the whole flow of the memory management control. Wherein BgAppManagerService is a service along with the start of the application, and the main function is dump information, such as manually triggering a memory detection once, opening or closing a detailed log switch, and printing the detailed information of the last 200 killed processes. KILLERTRIGGER define triggers for Process reclamation, such as trigger detection when the Task stack of Activity changes, trigger when the state of the Process changes, and timed Task trigger. WorkerDispatcher implements task dispatch from which any asynchronous task that needs to be executed needs to be dispatched to ensure that all required initialization content has been completed before the task actually executes, including tasks that need to be executed in the background thread and tasks that need to be executed in the main thread. Config provides functions of reading, loading, repairing, trigger checking and weight calculation for entity files corresponding to configuration files stored by the vehicle. MemoryAppKillerTask is a thread for actually executing the process memory killing, and if the current memory occupation percentage is compared with the threshold value configured in the configuration file, the process memory killing is performed according to the information configured in the configuration file if the current memory occupation percentage is more than the threshold value, and the operation is not performed if the current memory occupation percentage is not more than the threshold value. IACTIVITYMANAGER is a key component in the Android operating system, is responsible for managing the lifecycle and task stack of an application program, and can manage the application program, start Activity (Activity), process task switching, process lifecycle, and the like. KILLERTRIGGER defines triggers for process reclamation, and in particular, in terms of programming, a global List structure is defined in the class, and 3 kinds of trigger objects are added in the List structure, where the trigger objects include: TASKSTACKCHANGETRIGGER, triggering when the task stack changes; ProcessStateChangeTrigger triggering when the process state changes; timedTaskLooper are triggered periodically in time. All of these 3 types of Trigger objects implement Trigger interface WorkerDispatcher as described above in the section, implementing task dispatch, which, upon receiving an event from KILLERTRIGGER, distributes a work task to MemoryAppKillerTask, which completes the task's query and kill. And WorkerDispatcher, when the system is started, the configuration information of the xml file is read through the Config class and is analyzed into ProcessConfig and ProcessPriorityConfig objects, so that WorkerDispatcher is convenient to use. BgAppManagerService as described in the preceding section, the main function is dump information, allowing the developer to query WorkerDispatcher for task query history by inputting instructions through adbshell. In addition, the detailed log output may be turned off by the instruction "dumpsys ACTIVITY SERVICE com.rait.bgaphggr/com.rait.bgappmanager service log 0", the detailed log output may be turned on by the instruction "dumpsys ACTIVITY SERVICE com.rait.bgaphggr/com.rait.bgappmanager service log 1", The last 200 pieces of kill information can be printed by the instruction "dumpsys ACTIVITY SERVICE com.raite.bgapbgr/com.raite.bgapbgr.bgappmanager service traceLog".
In the embodiment, when an application program accessed in a terminal system is detected, memory inspection is performed on the terminal system; if the terminal system passes the memory check, acquiring configuration information of the application program from a preset configuration file corresponding to the terminal system; and when the current occupied memory ratio of the terminal system exceeds a preset threshold, judging whether to search and kill the application program according to the configuration information. Compared with the traditional memory management control method, the method of the embodiment obtains the configuration information of the related application program from the terminal system passing through the memory inspection, and searches and kills the application program according to the configuration information when the memory occupation of the terminal system is high, so that more memory is provided for the newly started application program, and the technical problem that the memory occupation of the terminal system is too high when the terminal system faces to the running scenes of a plurality of application programs is solved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a memory management control method according to a second embodiment of the present application.
In a possible implementation manner, the step S10 may include:
step S101: and when the terminal system reaches a preset detection triggering condition, detecting the terminal system, wherein the preset detection triggering condition comprises a timing triggering condition, a triggering condition after the process state changes and a triggering condition after the task stack changes.
It should be understood that the above-described timed trigger condition may refer to a condition that triggers a detection event at a particular time interval or moment. For example, a timed trigger condition may be set such that a detection event is performed at intervals, or at specific dates and times.
The trigger condition after the process state changes may refer to a condition that triggers a detection event when a state of a process changes, and the process state may include running, waiting, suspending, terminating, and the like. The system may trigger a detection event when a process transitions from one state to another.
The task stack post-change trigger condition may refer to a condition in a multitasking operating system or framework that triggers a detection event when a task stack (TASK STACK) changes. A task stack is a data structure used to manage the order and priority of execution of a plurality of tasks or applications. The system may trigger a detection event when a task in the task stack changes, such as a new task being added, a task being removed, or the order of the tasks changing.
Step S102: and when the access application program in the terminal system is detected, checking the total memory and the available memory of the terminal system.
In a possible embodiment, after the step S20, the method may further include:
step S21: if the total memory of the terminal system is in the first numerical value interval or the available memory duty ratio of the terminal system is in the second numerical value interval, judging that the terminal system does not pass the memory check, and outputting an error log.
The first value interval may be (- ≡0), and the second value interval may be (- ≡0)/(100, + -infinity) in addition, the product, the first value interval and the second value interval may also be defined by the user by himself, the present embodiment is not limited thereto.
In a specific implementation, when the total memory of the terminal system is located in the first value interval or the available memory duty ratio of the terminal system is located in the second value interval, it may be indicated that a memory related module in the terminal system may fail (e.g. a memory bank is damaged, memory data is lost, etc.), so it may be determined that the terminal system fails the memory check, and an error log may be output.
In a possible embodiment, after the step S30, the method may further include:
step S40: if the application program is detected to be checked and killed, the log information corresponding to the checking and killing is stored in a database, and the currently used memory duty ratio of the terminal system is updated.
Step S50: and if the updated currently used memory duty ratio does not exceed the preset threshold value, ending the checking and killing task.
It can be understood that if the updated currently available memory duty cycle exceeds the preset threshold, it indicates that the memory is still in a high occupancy state at this time. Therefore, the steps S10, S20 and S30 may be continuously executed to kill the application program until the currently available memory ratio does not exceed the preset threshold value, and the killing task is ended.
In the embodiment, when a terminal system reaches a preset detection trigger condition, the terminal system is detected, wherein the preset detection trigger condition comprises a timing trigger condition, a trigger condition after process state change and a trigger condition after task stack change; when the access application program in the terminal system is detected, checking the total memory and the available memory of the terminal system; if the total memory of the terminal system is in the first numerical value interval or the available memory duty ratio of the terminal system is in the second numerical value interval, judging that the terminal system does not pass the memory check, and outputting an error log; if the application program is detected to be checked and killed, storing log information corresponding to the checking and killing to a database, and updating the current used memory duty ratio of the terminal system; and if the updated currently used memory duty ratio does not exceed the preset threshold value, ending the checking and killing task. Compared with the traditional memory management control method, the method of the embodiment detects the terminal system based on the timing trigger condition, the trigger condition after the process state changes and the trigger condition after the task stack changes, so that the comprehensiveness of detection is improved; and meanwhile, the total memory and the available memory of the terminal system are checked, and the checking and killing task is ended when the current occupied memory ratio does not exceed a preset threshold value, so that the system occupation problem caused by the fact that the terminal system runs the checking and killing task when the terminal system is unnecessary is avoided.
Referring to fig. 5, fig. 5 is a flowchart illustrating a third embodiment of a memory management control method according to the present application.
In a possible implementation manner, the step S30 may include:
step S301: and screening the application programs belonging to the background process in the terminal system at the current moment from the application programs to obtain the application programs capable of being checked and killed.
In a specific implementation, whether the application is a foreground process or a background process may be determined according to oom _adj states of the application. OOM _adj is one Of the parameters used to manage the Memory management mechanism Of a process in the Linux kernel, and represents an ook (Out-Of-Memory) adjustment value Of the process. According to oom _adj, the memory management priority of the process can be judged, and whether the process is a foreground process or a background process is further deduced. Typically, OOM _adj has a value ranging from-17 to 15, and a smaller value indicates that the higher the memory management priority of the process is, the more susceptible to OOM killing.
Step S302: and determining the killing priority of the application programs capable of killing according to the configuration information, and killing the application programs capable of killing based on the killing priority.
In a possible implementation manner, the step S302 may include:
step S3021: and determining a state value of the searchable application program according to a preset process state definition table, and determining the initial searching and killing priority of the searchable application program based on the state value.
Step S3022: and adjusting the initial killing priority according to the configuration information to obtain an adjusted killing priority, and killing the application programs capable of killing based on the adjusted killing priority.
In a specific implementation, a Map table structure records of a recording process can be created, then a currently running process information list is acquired from the system AMS service, the process information list is recorded into a Map table according to a process name as an index, and if the process information exists in the Map table, state information of a corresponding process is updated. The priority of each process in the records table is calculated, the priority can be called as a weight value, and the smaller the value is, the more important the value is, and the smaller the value is, the killing cannot be performed. For a detailed process of calculation, reference may be made to the following steps: traversing each record of the records table, and finding out corresponding configuration information from the json configuration table; secondly, if one process cannot be found in the json configuration table, marking the priority of the process as-1, namely not searching and killing the process; thirdly, if a certain process is set in the json configuration table to be not checked and killed, marking the priority of the process as-1; the fourth step, calculating the maximum priority of the process, the second step has acquired the information of the process, the definition of the state of the process is shown in table 1, the larger the state value of the process is, the less important the process (the configuration rule of the android native system) is, and the program calculation logic: when the state value of the process > =the state value in the configuration table and the duration of the state > =the duration of the json configuration table and the configuration table, the priority set in the configuration table is returned to the caller. (it can be simply understood that when a process is in a state of less importance, the duration exceeds the duration in the configuration table, and we prefer to check and kill it); and fifthly, returning the priority calculated in the step 4.4 to the caller. And finally, filtering the calculated records table to remove the progress which cannot be killed, and returning the final list to the caller.
In the embodiment, the application program belonging to the background process in the terminal system at the current moment is screened from the application programs to obtain the application program capable of being checked and killed; determining a state value of the searchable application according to a preset process state definition table, and determining an initial searching and killing priority of the searchable application based on the state value; and adjusting the initial killing priority according to the configuration information to obtain an adjusted killing priority, and killing the application programs capable of killing based on the adjusted killing priority. Compared with the traditional memory management control method, the method of the embodiment screens out the application programs which can be checked out from the application programs, and then checks out the application programs which can be checked out based on the checking out priority determined by the configuration information, so that redundant processing of the application programs which cannot be checked out is avoided, and further checking out efficiency is improved.
In addition, the embodiment of the application also provides a storage medium, wherein a memory management control program is stored on the storage medium, and the memory management control program realizes the steps of the memory management control method when being executed by a processor.
Referring to fig. 6, fig. 6 is a block diagram illustrating a first embodiment of a memory management control device according to the present application.
As shown in fig. 6, a memory management control device according to an embodiment of the present application includes:
The memory checking module 601 is configured to perform memory checking on a terminal system when detecting that an application program is accessed into the terminal system;
The information obtaining module 602 is configured to obtain, if the terminal system passes the memory check, configuration information of the application program from a preset configuration file corresponding to the terminal system;
and the process checking and killing module 603 is configured to determine whether to check and kill the application program according to the configuration information when the currently used memory duty ratio of the terminal system exceeds a preset threshold.
In the embodiment, when an application program accessed in a terminal system is detected, memory inspection is performed on the terminal system; if the terminal system passes the memory check, acquiring configuration information of the application program from a preset configuration file corresponding to the terminal system; and when the current occupied memory ratio of the terminal system exceeds a preset threshold, judging whether to search and kill the application program according to the configuration information. Compared with the traditional memory management control method, the method of the embodiment obtains the configuration information of the related application program from the terminal system passing through the memory inspection, and searches and kills the application program according to the configuration information when the memory occupation of the terminal system is high, so that more memory is provided for the newly started application program, and the technical problem that the memory occupation of the terminal system is too high when the terminal system faces to the running scenes of a plurality of application programs is solved.
Based on the first embodiment of the memory management control device of the present application, a second embodiment of the memory management control device of the present application is provided.
In this embodiment, the memory inspection module 601 is further configured to detect a terminal system when the terminal system reaches a preset detection trigger condition, where the preset detection trigger condition includes a timing trigger condition, a post-process state change trigger condition, and a post-task stack change trigger condition; and when the access application program in the terminal system is detected, checking the total memory and the available memory of the terminal system.
Further, the information obtaining module 602 is further configured to determine that the terminal system fails the memory check if the total memory of the terminal system is within the first value interval or the available memory duty cycle of the terminal system is within the second value interval, and output an error log.
Further, the process checking and killing module 603 is further configured to screen out an application program belonging to a background process in the terminal system at the current moment from the application programs, so as to obtain a checkable application program; and determining the killing priority of the application programs capable of killing according to the configuration information, and killing the application programs capable of killing based on the killing priority.
Further, the process killing module 603 is further configured to determine a state value of the application program according to a preset process state definition table, and determine an initial killing priority of the application program based on the state value; and adjusting the initial killing priority according to the configuration information to obtain an adjusted killing priority, and killing the application programs capable of killing based on the adjusted killing priority.
Further, the process searching and killing module 603 is further configured to store log information corresponding to the searching and killing to a database if the application program is detected to be searched and killed, and update a currently used memory duty ratio of the terminal system; and if the updated currently used memory duty ratio does not exceed the preset threshold value, ending the checking and killing task.
Other embodiments or specific implementations of the memory management control device of the present application may refer to the above method embodiments, and are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. read-only memory/random-access memory, magnetic disk, optical disk), comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (10)
1. A memory management control method, the method comprising the steps of:
When detecting that an application program is accessed into a terminal system, performing memory check on the terminal system;
If the terminal system passes the memory check, acquiring configuration information of the application program from a preset configuration file corresponding to the terminal system;
and when the current occupied memory ratio of the terminal system exceeds a preset threshold, judging whether to search and kill the application program according to the configuration information.
2. The memory management control method as claimed in claim 1, wherein the step of performing memory check on the terminal system when detecting access of the application program in the terminal system comprises:
when a terminal system reaches a preset detection triggering condition, detecting the terminal system, wherein the preset detection triggering condition comprises a timing triggering condition, a triggering condition after process state change and a triggering condition after task stack change;
and when the access application program in the terminal system is detected, checking the total memory and the available memory of the terminal system.
3. The memory management control method according to claim 1, wherein after the step of obtaining the configuration information of the application program from the preset configuration file corresponding to the terminal system if the terminal system passes the memory check, the method further comprises:
If the total memory of the terminal system is in the first numerical value interval or the available memory duty ratio of the terminal system is in the second numerical value interval, judging that the terminal system does not pass the memory check, and outputting an error log.
4. The memory management control method according to claim 1, wherein the step of determining whether to search and kill the application program according to the configuration information includes:
Screening application programs belonging to background processes in the terminal system at the current moment from the application programs to obtain application programs capable of being checked and killed;
And determining the killing priority of the application programs capable of killing according to the configuration information, and killing the application programs capable of killing based on the killing priority.
5. The memory management control method according to claim 4, wherein the step of determining the killing priority of the killing-capable application program according to the configuration information and killing the killing-capable application program based on the killing priority includes:
determining a state value of the searchable application according to a preset process state definition table, and determining an initial searching and killing priority of the searchable application based on the state value;
And adjusting the initial killing priority according to the configuration information to obtain an adjusted killing priority, and killing the application programs capable of killing based on the adjusted killing priority.
6. The memory management control method according to claim 1, wherein after the step of determining whether to kill the application program according to the configuration information when the currently used memory duty ratio of the terminal system exceeds a preset threshold, further comprising:
If the application program is detected to be checked and killed, storing log information corresponding to the checking and killing to a database, and updating the current used memory duty ratio of the terminal system;
and if the updated currently used memory duty ratio does not exceed the preset threshold value, ending the checking and killing task.
7. A memory management control apparatus, characterized in that the memory management control apparatus comprises:
The memory checking module is used for checking the memory of the terminal system when detecting that the terminal system is accessed to the application program;
the information acquisition module is used for acquiring the configuration information of the application program from a preset configuration file corresponding to the terminal system if the terminal system passes the memory check;
And the process checking and killing module is used for judging whether to check and kill the application program according to the configuration information when the current occupied memory ratio of the terminal system exceeds a preset threshold value.
8. A memory management control apparatus, the apparatus comprising: a memory, a processor and a memory management control program stored on the memory and executable on the processor, the memory management control program being configured to implement the steps of the memory management control method of any one of claims 1 to 6.
9. A storage medium, characterized in that the storage medium is a computer-readable storage medium, on which a memory management control program is stored, which when executed by a processor implements the steps of the memory management control method according to any one of claims 1 to 6.
10. A computer program product comprising a memory management control program which, when executed by a processor, implements the steps of the memory management control method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410563039.8A CN118394600A (en) | 2024-05-08 | 2024-05-08 | Memory management control method, device, equipment, storage medium and product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410563039.8A CN118394600A (en) | 2024-05-08 | 2024-05-08 | Memory management control method, device, equipment, storage medium and product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118394600A true CN118394600A (en) | 2024-07-26 |
Family
ID=91986768
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410563039.8A Pending CN118394600A (en) | 2024-05-08 | 2024-05-08 | Memory management control method, device, equipment, storage medium and product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118394600A (en) |
-
2024
- 2024-05-08 CN CN202410563039.8A patent/CN118394600A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110941528B (en) | Log buried point setting method, device and system based on fault | |
US20170322826A1 (en) | Setting support program, setting support method, and setting support device | |
CN108776643B (en) | Target code merging control method and system based on version control process | |
CN110427258B (en) | Resource scheduling control method and device based on cloud platform | |
CN109684573B (en) | Target picture display method and device, storage medium and electronic equipment | |
CN109710596B (en) | Data cleaning method, device, equipment and computer readable storage medium | |
CN109359092B (en) | File management method, desktop display method, device, terminal and medium | |
CN113157411A (en) | Reliable configurable task system and device based on Celery | |
CN106997313B (en) | Signal processing method and system of application program and terminal equipment | |
CN112612537A (en) | Configuration data caching method, device, equipment and storage medium | |
CN110231921B (en) | Log printing method, device, equipment and computer readable storage medium | |
CN116755719A (en) | Data processing method, device and data processing system of application component | |
CN118394600A (en) | Memory management control method, device, equipment, storage medium and product | |
CN115622884A (en) | Configuration data change processing method and device and computer equipment | |
US20230088318A1 (en) | Remotely healing crashed processes | |
CN114691496A (en) | Unit testing method, unit testing device, computing equipment and medium | |
CN114968505A (en) | Task processing system, method, device, apparatus, storage medium, and program product | |
CN113609478A (en) | IOS platform application program tampering detection method and device | |
CN113656378A (en) | Server management method, device and medium | |
CN112596783A (en) | Code automatic merging method and device, computer equipment and storage medium | |
CN106055322A (en) | Flow scheduling method and device | |
CN112257106A (en) | Data detection method and device | |
CN114253825A (en) | Memory leak detection method and device, computer equipment and storage medium | |
CN111158873A (en) | System state machine implementation method and device, storage medium and processor | |
CN115952006B (en) | Method, system, device, server and storage medium for detecting resource leakage |
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 |