A memory recycling method, device and computer readable storage medium

By encapsulating memory reclamation requests as events and combining them with dynamic configuration and cloud analytics, the system resolves the lag issues caused by old generation memory reclamation in Android, achieving low-cost, high-efficiency memory management and protecting device and user space.

CN123137908APending Publication Date: 2026-11-20NUBIA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611316635.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing technologies, Android systems are prone to application lag when reclaiming old generation memory, and simply increasing memory or virtual memory can lead to high device costs and reduced disk space usage, thus reducing the available space for users.

Method used

The application's memory reclamation requests are encapsulated into memory reclamation request events. Combining the event parameters of the memory reclamation request events, the current operating status of the device, and dynamic configurations, including the old generation trigger threshold and dynamic heap size adjustment coefficient, the optimal memory allocation strategy is generated through cluster analysis and machine learning on the cloud server, and memory scheduling is dynamically adjusted.

Benefits of technology

It achieves a low-cost memory reclamation solution, avoids application lag caused by old generation reclamation, protects the lifespan of device disks and user storage space, and improves the accuracy and effectiveness of memory allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123137908A_ABST
    Figure CN123137908A_ABST
Patent Text Reader

Abstract

The application discloses a memory recycling method, device and computer readable storage medium, and the method comprises the following steps: encapsulating a memory recycling request of an application into a memory recycling request event; performing current memory scheduling according to event parameters of the memory recycling request event, a running state of a current device and dynamic configuration, wherein the dynamic configuration comprises a young generation trigger threshold and a dynamic heap size adjustment coefficient of the application in different time periods. The application realizes a memory recycling scheme with lower hardware cost and independent of virtual memory, protects the disk life of the device and the storage space of the user, and effectively avoids the application lag problem caused by the old generation recycling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software technology, and in particular to a memory reclamation method, apparatus, and computer-readable storage medium. Background Technology

[0002] In existing technologies, the Android system is based on the JVM (Java Virtual Machine), and each system and application has its own memory management mechanism.

[0003] Currently, as memory usage increases, various applications will trigger memory reclamation; however, when it comes to old generation memory reclamation, it may cause application lag; in order to optimize memory reclamation, most device manufacturers will continuously increase the actual memory space of the device or introduce the device's disk space as virtual memory.

[0004] However, the above solutions have some problems: First, increasing the actual memory of the device will lead to higher and higher device costs; second, increasing the virtual memory of the device will occupy disk space and reduce the space available for users to store data.

[0005] Therefore, how to effectively implement memory reclamation, avoid simply increasing memory or virtual memory, and reduce the impact of memory regulation on users has become an urgent technical problem to be solved. Summary of the Invention

[0006] In order to overcome the shortcomings of the prior art, the present invention aims to provide a memory reclamation method, device and computer-readable storage medium to solve the problem that when facing memory reclamation needs, simply increasing the amount of physical memory or virtual memory will lead to higher and higher device costs, occupy disk space of the device and reduce the space available for users to store data.

[0007] This invention proposes a memory reclamation method, which includes: Encapsulate the application's memory reclamation requests into memory reclamation request events; The current memory scheduling is performed based on the event parameters of the memory reclamation request event, the current operating status of the device, and the dynamic configuration, which includes the old generation trigger threshold and the dynamic heap size adjustment coefficient applied at different time periods.

[0008] Optionally, before encapsulating the application's memory reclamation request into a memory reclamation request event, the following steps are included: Collect characteristic data of the application during runtime, including memory expansion curves of each generation of the application, garbage collection trigger frequency, frame rate jitter caused by a single garbage collection, and the current remaining physical memory of the system. Feature data is reported to the cloud server so that the cloud server can perform cluster analysis and regression prediction on the feature data to obtain a heatmap of memory usage behavior corresponding to the device or the user of the device.

[0009] Optionally, before encapsulating the application's memory reclamation request into a memory reclamation request event, the following is also included: Obtain dynamic configurations issued by the cloud server, whereby the dynamic configurations are calculated by the cloud server based on a heatmap of memory usage behavior; Dynamic configurations are loaded through the device's system framework layer, and current memory scheduling is performed in conjunction with event parameters and running status.

[0010] Optionally, the method for determining the dynamic configuration also includes: The memory expansion curve is converted into a slope value, and the garbage collection trigger frequency and frame rate jitter are summarized into a unit time average, which together with the remaining physical memory of the system constitutes the feature vector of each sample. The feature vectors are clustered using a pre-defined algorithm. If a sample is assigned to a cluster with high recycling frequency, high frame rate jitter, and low remaining memory, the sample is identified as a high-risk abnormal cluster, and the memory allocation priority of the sample is increased.

[0011] Optionally, the method for determining the dynamic configuration also includes: The model is trained by taking the current memory expansion curve, garbage collection trigger frequency, frame rate jitter, and remaining physical memory of the system as input features and the actual performance indicators of future time as target values. After model training, real-time collected input features are input again, and the model outputs predicted values ​​to trigger resource expansion or rate limiting protection in advance.

[0012] Optionally, the method for determining the dynamic configuration also includes: Preset the current time dimension and group dimension; The raw memory data is grouped according to the time dimension and / or the group dimension to obtain a basic cell of the memory usage behavior heatmap.

[0013] Optionally, the method for determining the dynamic configuration also includes: Within an adjustment cycle, collect data on memory expansion curves, garbage collection trigger frequency, frame rate jitter, and remaining system physical memory to calculate statistical values ​​for the current adjustment cycle. The current time period configuration is obtained by matching the statistical value with the current time, and the corresponding virtual machine parameters are loaded according to the time period configuration.

[0014] Optionally, the method for determining the dynamic configuration also includes: Limit the virtual machine parameters; The processed virtual machine parameters are sent to the application's virtual machine instance so that the processed virtual machine parameters take effect in the next adjustment cycle.

[0015] The present invention also proposes a memory reclamation device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the memory reclamation method as described in any of the preceding claims.

[0016] The present invention also proposes a computer-readable storage medium storing a memory reclamation program, which, when executed by a processor, implements the steps of the memory reclamation method as described in any of the preceding claims.

[0017] The memory reclamation method, apparatus, and computer-readable storage medium of this invention encapsulate application memory reclamation requests into memory reclamation request events; and perform current memory scheduling based on event parameters of the memory reclamation request events, the current operating state of the device, and dynamic configuration, wherein the dynamic configuration includes the old generation trigger threshold and dynamic heap size adjustment coefficient for the application at different time periods. This achieves a memory reclamation scheme with lower hardware costs and no reliance on virtual memory, protecting the device's disk lifespan and the user's storage space, and effectively avoiding application lag issues caused by old generation reclamation. Attached Figure Description

[0018] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a flowchart of the first embodiment of the memory reclamation method of the present invention; Figure 2 This is a flowchart of the second embodiment of the memory reclamation method of the present invention; Figure 3 This is a flowchart of the third embodiment of the memory reclamation method of the present invention; Figure 4 This is a flowchart of the fourth embodiment of the memory reclamation method of the present invention; Figure 5 This is a flowchart of the fifth embodiment of the memory reclamation method of the present invention; Figure 6 This is a flowchart of the sixth embodiment of the memory reclamation method of the present invention; Figure 7 This is a flowchart of the seventh embodiment of the memory reclamation method of the present invention; Figure 8 This is a flowchart of the eighth embodiment of the memory reclamation method of the present invention. Detailed Implementation

[0019] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0020] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0021] Example 1 Figure 1 This is a flowchart of the first embodiment of the memory reclamation method of the present invention. A memory reclamation method, the method comprising: S1. Encapsulate the application's memory reclamation request into a memory reclamation request event; S2. Execute the current memory scheduling based on the event parameters of the memory reclamation request event, the current operating status of the device, and the dynamic configuration, where the dynamic configuration includes the old generation trigger threshold and the dynamic heap size adjustment coefficient applied at different time periods.

[0022] In this embodiment, the memory reclamation interception agent, process behavior monitoring, shared memory dynamic conversion, and configuration policy dynamic loading are implemented in the system kernel of the device; furthermore, the optimal memory space allocation policy generation matrix based on user profiles and memory behavior machine learning models is implemented on the cloud server.

[0023] In this embodiment, when the device's system starts, the underlying core garbage collection library of the virtual machine is modified to intercept the entry methods of all applications that originally pointed to their own virtual machine garbage collectors. After interception, the application's memory reclamation request is no longer executed independently and immediately, but is encapsulated into a memory reclamation request event. This event includes parameters such as process ID, current memory level, and density of surviving objects in the old generation. This event is asynchronously submitted to the unified memory reclamation strategy on the system side. The system side will determine whether the application should perform memory reclamation in a concurrent background, delayed compression, or immediate shared reuse manner based on the overall CPU load and foreground / background status of the current device. This switches the arbitrary reclamation of a single application to a system-level global ordered scheduling, thereby avoiding the golden time when users are interacting frequently and reducing the actual impact of memory reclamation on users.

[0024] In this embodiment, the system-side monitoring sandbox continuously and imperceptibly collects characteristic data of users running different applications (such as WeChat, large games, Taobao), including but not limited to: memory expansion curves of each application's generation (young generation, old generation, permanent generation), garbage collection trigger frequency, frame rate jitter caused by a single garbage collection, and the current remaining physical memory of the system.

[0025] In this embodiment, the aforementioned feature data is anonymized and reported to the cloud server when the device is idle and connected to Wi-Fi; the cloud machine learning model uses cluster analysis and regression prediction to draw a heatmap of memory usage behavior for the specific device or user group, and calculates an optimal dynamic memory space allocation mechanism; the core indicators of this mechanism include: dedicated (old generation trigger threshold) and dynamic heap size adjustment coefficient for different applications at different times.

[0026] In this embodiment, the cloud encapsulates the calculated optimal mechanism into a lightweight configuration and sends it to the system framework layer of the corresponding device; the configuration strategy dynamic loader on the system side takes effect in real time, dynamically adjusting the underlying parameters of the virtual machines of each running application, so that the application has been gracefully pre-reclaimed in the background by the system before a large amount of old generation memory backlog occurs.

[0027] The beneficial effect of this embodiment is that it encapsulates application memory reclamation requests into memory reclamation request events; and performs current memory scheduling based on the event parameters of the memory reclamation request events, the current operating state of the device, and dynamic configuration, where dynamic configuration includes the old generation trigger threshold and dynamic heap size adjustment coefficient for the application at different time periods. This achieves a memory reclamation scheme with lower hardware costs and no reliance on virtual memory, protecting the device's disk lifespan and the user's storage space, and effectively avoiding application lag issues caused by old generation reclamation.

[0028] Example 2 Figure 2 This is a flowchart of the second embodiment of the memory reclamation method of the present invention. Based on the above embodiment, before encapsulating the application's memory reclamation request into a memory reclamation request event, it includes: S01. Collect the application's runtime characteristic data, including the memory expansion curves of each generation of the application, the frequency of garbage collection triggers, the frame rate jitter caused by a single garbage collection, and the current remaining physical memory of the system. S02. The feature data is reported to the cloud server so that the cloud server can perform cluster analysis and regression prediction on the feature data to obtain a heatmap of memory usage behavior corresponding to the device or the user of the device.

[0029] In this embodiment, instead of intercepting the memory reclamation method entry points of each application from the system side of the device, a unified memory reclamation scheme is called. Then, through a machine learning mechanism, the memory data model, reclamation frequency, and lag situation of each user when using different applications are learned and reported to the service side.

[0030] The beneficial effect of this embodiment is that the server calculates the optimal memory data space allocation mechanism and pushes it to the corresponding device, so that the device can use the optimal mechanism calculated by the server to reclaim memory in the daily unified memory reclamation scheme.

[0031] Example 3 Figure 3 This is a flowchart of the third embodiment of the memory reclamation method of the present invention. Based on the above embodiment, before encapsulating the application's memory reclamation request into a memory reclamation request event, it further includes: S03. Obtain the dynamic configuration issued by the cloud server, wherein the dynamic configuration is calculated by the cloud server based on the memory usage behavior heatmap; S04. Load the dynamic configuration through the device's system framework layer and perform the current memory scheduling in combination with event parameters and running status.

[0032] In this embodiment, since all the execution logic of memory monitoring, hook interception, cross-process replacement and policy calculation resides entirely in the system daemon process and kernel space, the sandbox integrity of the application layer's runtime environment is not compromised.

[0033] In this embodiment, the application does not need to integrate any SDK or modify any line of business code, achieving complete zero intrusion and zero awareness of the application space, thus eliminating the risk of secondary lag caused by the application's own logical defects from the root.

[0034] The beneficial effects of this embodiment are that, through the above solution, hardware stacking is eliminated to a certain extent, hardware costs are greatly reduced, virtual memory is not relied upon, the lifespan of the device disk and user space are protected, application lag caused by old generation recycling is avoided, and combined with cloud service machine learning, users can feel a smoother and better experience the more they use it.

[0035] Example 4 Figure 4 This is a flowchart of the fourth embodiment of the memory reclamation method of the present invention. Based on the above embodiment, the method further includes: S10. Convert the memory expansion curve into a slope value, summarize the garbage collection trigger frequency and frame rate jitter into a unit time average, and combine them with the remaining physical memory of the system to form the feature vector of each sample. S20. Use a preset algorithm to perform cluster analysis on the feature vectors. If a sample is assigned to a cluster with high recycling trigger frequency, high frame rate jitter, and low remaining memory, the sample is determined to be a high-risk abnormal cluster, and the memory allocation priority of the sample is increased.

[0036] In this embodiment, the four indicators—memory bloat curve, garbage collection trigger frequency, frame rate jitter during a single garbage collection, and remaining physical memory—are standardized. For example, the "memory bloat curve" is converted into a slope value, and the "garbage collection trigger frequency" and "frame rate jitter" are summarized into a unit time average, which, together with the "remaining physical memory," constitute the feature vector of each sample. Furthermore, the K-Means algorithm is used for cluster analysis. After clustering, if a sample is assigned to a cluster of "high GC frequency + high frame rate jitter + low remaining memory," it can be determined as a high-risk abnormal cluster, and memory should be allocated to it first.

[0037] The beneficial effect of this embodiment is that by using a preset algorithm to perform cluster analysis on the feature vectors, high-risk abnormal clusters can be identified, and their memory allocation priority can be increased in a targeted manner, thereby improving the effectiveness and accuracy of memory reclamation.

[0038] Example 5 Figure 5 This is a flowchart of the fifth embodiment of the memory reclamation method of the present invention. Based on the above embodiment, the method further includes: S30. Use the current memory expansion curve, garbage collection trigger frequency, frame rate jitter, and remaining physical memory of the system as input features, and use the actual performance indicators of future moments as target values ​​to train the model. S40. After model training, input features collected in real time are input again, and the model outputs predicted values ​​to trigger resource expansion or rate limiting protection in advance.

[0039] In this embodiment, the four indicators at the current moment are used as input features X, and the actual performance indicators at future moments (such as the frame rate at the next moment) are used as target values ​​Y for model training.

[0040] In this embodiment, if the amount of data is small or interpretability is desired, linear regression or random forest regression can be used for model training; if the amount of data is large and nonlinear, XGBoost or LSTM (Long Short-Term Memory Network) can be used for model training.

[0041] The beneficial effect of this embodiment is that, by using the above-mentioned training model and inputting four feature data collected in real time, the model can output a predicted value, thereby realizing the early triggering of resource expansion or rate limiting protection.

[0042] Example 6 Figure 6 This is a flowchart of the sixth embodiment of the memory reclamation method of the present invention. Based on the above embodiment, the method further includes: S50, Preset the current time dimension and group dimension; S60. Group the original memory data according to the time dimension and / or group dimension to obtain a basic cell of the memory usage behavior heatmap.

[0043] In this embodiment, the memory usage data reported by the device and user account is normalized. Specifically, the time dimension (such as the hour of the day) and the group dimension (specific device model or user tag) are selected, and the raw memory data is grouped according to the selected dimensions; for example, the "average memory usage rate of a certain device model during the 'lunch break (12-14 o'clock)'" is calculated to form a basic cell of the heat map.

[0044] The beneficial effect of this embodiment is that by grouping the original memory data according to the time dimension and / or the group dimension, a basic cell of the memory usage behavior heatmap is obtained, thereby realizing the normalization processing of memory usage data reported by devices and user accounts.

[0045] Example 7 Figure 7 This is a flowchart of the seventh embodiment of the memory reclamation method of the present invention. Based on the above embodiment, the method further includes: S70. Within an adjustment cycle, collect the memory expansion curve, garbage collection trigger frequency, frame rate jitter, and remaining physical memory of the system, and calculate the statistical values ​​for the current adjustment cycle. S80. The current time period configuration is obtained by matching the statistical value with the current time. The corresponding virtual machine parameters are loaded according to the time period configuration.

[0046] In this embodiment, specific data (old generation trigger threshold and dynamic heap size adjustment coefficient) for different applications at different times are obtained. Specifically, within each adjustment cycle, four types of characteristic data are continuously collected (i.e., the memory expansion curve, reclamation frequency, frame rate jitter, and remaining physical memory mentioned above). At the end of the adjustment cycle, the statistical values ​​for this cycle are calculated, such as the linear regression slope and the total number of reclamations within the cycle. Finally, a preset time period strategy is matched according to the current time. For example, corresponding time period strategies are matched for midday peak hours and nighttime off-peak hours, and corresponding JVM (Java Virtual Machine) parameters are loaded for different time periods.

[0047] Example 8 Figure 8 This is a flowchart of the eighth embodiment of the memory reclamation method of the present invention. Based on the above embodiment, the method further includes: S90. Limit the virtual machine parameters; S100. The processed virtual machine parameters are sent to the application's virtual machine instance so that the processed virtual machine parameters take effect in the next adjustment cycle.

[0048] In this embodiment, to prevent system instability caused by parameter mutations, the calculated new values ​​are limited; for example, the threshold is limited to 50%-90%, and the coefficient is limited to 0.5-1.5; furthermore, the new parameters within the safe range are sent to the JVM instance of the target application so that they take effect in the next adjustment cycle.

[0049] Furthermore, in this embodiment, the service side, based on the memory usage data reported by the device and combined with the algorithm described in the above-mentioned optimal memory space dynamic allocation mechanism, will push lightweight configuration and optimization parameters to the device's system framework for use once it detects that a change in strategy is needed.

[0050] Furthermore, in this embodiment, the methods for determining whether the current application is processed in a concurrent background recycling, delayed compression recycling, or immediate sharing and reuse manner include: First, when the CPU load is high, it means that the application is running under heavy load. At this time, use the concurrent background reclamation method, that is, reduce the frequency of memory reclamation and increase the available memory space, and make appropriate use of disk as virtual memory to reduce the use of CPU. Second, when the application remains in the foreground, use a delayed compression and recycling method. This means checking the memory data that is likely no longer used in the application, compressing it, but not releasing it. The data is then released when the application is moved to the background and confirmed to be no longer in use. Third, when an application is switched to the foreground, use the immediate sharing and reuse method, that is, obtain the memory space from several applications that have been in the background for a long time and share and reuse it. Regarding the third scenario mentioned above, in a specific example, when the system detects that application A has switched to the background and is no longer active for a short period of time, the system-level memory reclamation scheme will not perform time-consuming garbage collection and memory erasure on application A. Instead, it will directly and quickly unbind the physical memory pages occupied by application A that are within the scope of being freed from application A's virtual address space by modifying the page table mapping mechanism at the kernel level. The system will then quickly map these physical memory pages, which have been marked as freed / reusable, directly into the virtual address space of application B, which is currently in the foreground and urgently needs memory. Application B will perceive that its memory is instantly replenished without triggering its own old generation garbage collector to clean up the space. It is easy to see that since the operation of modifying the page table mapping only takes microseconds in the kernel, the first frame stutter caused by temporary memory reclamation when application B switches is completely eliminated.

[0051] In this embodiment, firstly, a unified memory reclamation scheme is implemented on the system side of the device. The system side intercepts the memory reclamation method entry points of each application and instead calls the unified memory reclamation scheme. Then, a machine learning mechanism is introduced to learn the memory data model, reclamation frequency, and lag issues of each user when using different applications, and reports this to the server side. The server side calculates the optimal memory data space allocation mechanism and pushes it to the corresponding device. Finally, in the unified memory reclamation scheme, the optimal mechanism calculated by the server side is used so that when switching between multiple applications, the application memory of the released space can be immediately allocated to the current application, thereby significantly reducing the memory reclamation time of the current application. Furthermore, the memory reclamation mechanism is performed entirely on the system side and has no impact on the application space, thus solving the lag problem of the application itself.

[0052] Example 9 Based on the above embodiments, the present invention also proposes a memory reclamation device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the memory reclamation method as described in any of the above embodiments.

[0053] It should be noted that the above-described device embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the device embodiments, which will not be repeated here.

[0054] Example 10 Based on the above embodiments, the present invention also proposes a computer-readable storage medium storing a memory reclamation program, wherein when the memory reclamation program is executed by a processor, the steps of the memory reclamation method as described in any of the above embodiments are implemented.

[0055] It should be noted that the above-described medium embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the medium embodiments, which will not be repeated here.

[0056] The memory reclamation method, apparatus, and computer-readable storage medium of this invention encapsulate application memory reclamation requests into memory reclamation request events; and perform current memory scheduling based on event parameters of the memory reclamation request events, the current operating state of the device, and dynamic configuration, wherein the dynamic configuration includes the old generation trigger threshold and dynamic heap size adjustment coefficient for the application at different time periods. This achieves a memory reclamation scheme with lower hardware costs and no reliance on virtual memory, protecting the device's disk lifespan and the user's storage space, and effectively avoiding application lag issues caused by old generation reclamation.

[0057] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0058] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0059] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0060] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A memory reclamation method, characterized in that, The method includes: Encapsulate the application's memory reclamation requests into memory reclamation request events; The current memory scheduling is performed based on the event parameters of the memory reclamation request event, the current operating status of the device, and the dynamic configuration, wherein the dynamic configuration includes the old generation trigger threshold and the dynamic heap size adjustment coefficient of the application at different time periods.

2. The memory reclamation method according to claim 1, characterized in that, Before encapsulating the application's memory reclamation request into a memory reclamation request event, the following is included: Collect the characteristic data of the application during runtime, including the memory expansion curve of each generation of the application, the frequency of garbage collection triggering, the frame rate jitter caused by a single garbage collection, and the current remaining physical memory of the system. The feature data is reported to the cloud server so that the cloud server can perform cluster analysis and regression prediction on the feature data to obtain a heatmap of memory usage behavior corresponding to the device or the user of the device.

3. The memory reclamation method according to claim 2, characterized in that, Before encapsulating the application's memory reclamation request into a memory reclamation request event, the method further includes: Obtain the dynamic configuration issued by the cloud server, wherein the dynamic configuration is calculated by the cloud server based on the memory usage behavior heatmap; The dynamic configuration is loaded through the device's system framework layer, and the current memory scheduling is performed in conjunction with the event parameters and the running status.

4. The memory reclamation method according to claim 3, characterized in that, The method for determining the dynamic configuration includes: The memory expansion curve is converted into a slope value, the garbage collection trigger frequency and the frame rate jitter are summarized into a unit time average, and together with the remaining physical memory of the system, they form the feature vector of each sample. The feature vectors are clustered using a preset algorithm. If a sample is assigned to a cluster with high recycling trigger frequency, high frame rate jitter, and low remaining memory, the sample is determined to be a high-risk abnormal cluster, and the memory allocation priority of the sample is increased.

5. The memory reclamation method according to claim 4, characterized in that, The method for determining the dynamic configuration further includes: The model is trained by taking the current memory expansion curve, garbage collection trigger frequency, frame rate jitter, and remaining physical memory of the system as input features and the actual performance indicators at future times as target values. After the model is trained, real-time collected input features are input again, and the model outputs predicted values ​​to trigger resource expansion or rate limiting protection in advance.

6. The memory reclamation method according to claim 5, characterized in that, The method for determining the dynamic configuration further includes: Preset the current time dimension and group dimension; The original memory data is grouped according to the time dimension and / or the group dimension to obtain a basic cell of the memory usage behavior heatmap.

7. The memory reclamation method according to claim 6, characterized in that, The method for determining the dynamic configuration further includes: Within an adjustment cycle, the memory expansion curve, the garbage collection trigger frequency, the frame rate jitter, and the remaining physical memory of the system are collected to calculate the statistical values ​​for the current adjustment cycle. The current time period configuration is obtained by matching the statistical value with the current time, wherein the corresponding virtual machine parameters are loaded according to the time period configuration.

8. The memory reclamation method according to claim 7, characterized in that, The method for determining the dynamic configuration further includes: The virtual machine parameters are subjected to amplitude limiting. The processed virtual machine parameters are sent to the virtual machine instance of the application so that the processed virtual machine parameters take effect in the next adjustment cycle.

9. A memory recycling device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the memory reclamation method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an application memory reclamation program, which, when executed by a processor, implements the steps of the memory reclamation method as described in any one of claims 1 to 8.