Memory scheduling method, device and system, storage medium and program product

By adding a memory management module to the K8s environment and dynamically releasing container group memory resources, the problem of container group memory waste is solved, and elastic scaling and efficient utilization of memory resources are achieved.

CN120704846APending Publication Date: 2025-09-26HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410309118.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the K8s environment, the dynamic changes in memory usage of container groups result in the inability to reclaim idle memory in a timely manner, resulting in waste of memory resources and affecting the deployment and use of other container groups.

Method used

By adding a memory management module to the application's running environment, monitoring actual memory usage information and dynamically releasing free memory, and combining the actual memory usage of each application in the container group, adjusting the container group's memory request amount, elastic scaling of memory resources can be achieved.

Benefits of technology

It effectively avoids the waste of memory resources, improves the utilization rate of memory resources, and the saved memory resources can be used for scheduling and allocation by the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704846A_ABST
    Figure CN120704846A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a memory scheduling method, device and system, a storage medium and a program product. In the embodiment of the invention, a memory elastic release function is provided for an application program by using a running environment bearing the application program, and a part of memory application quantity applied by the application program from a working node is dynamically released, so that the actual memory occupation quantity of the application program is obtained; furthermore, the actual memory demand quantity of the container group is determined on the basis of the actual memory occupation quantity of each application program in the container group, and the memory request quantity configured to the container group is dynamically adjusted according to the actual memory demand quantity of the container group, so that the elastic expansion and contraction of the memory request quantity of the container group are realized, the reasonable utilization of memory resources is further realized, and the memory utilization rate is improved. Waste of memory resources is avoided, the saved memory resources can be scheduled and allocated by an operating system, and the utilization rate of the memory resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a memory scheduling method, device, system, storage medium, and program product. Background Art

[0002] Containerization is a virtualization technology that allows applications and their dependencies to be packaged into an independent, portable runtime environment. By creating containers on a host machine and deploying applications in them, isolation and restriction between applications can be achieved.

[0003] K8s (short for Kubernetes) is an open-source container orchestration platform that automates the deployment, scaling, and management of containers. In a K8s environment, a pod is the basic deployment unit, consisting of one or more containers, in which user applications are deployed.

[0004] In a Kubernetes environment, you configure a memory request (Request) and a memory limit (Limit) for a Pod to limit the memory resources it uses. Ideally, a Pod can use the memory request but not exceed the memory limit. In real-world scenarios, a Pod's memory usage changes dynamically. If a Pod's memory usage is lower than its memory request, the unused memory is still occupied by the Pod, resulting in wasted memory resources. Summary of the Invention

[0005] Various aspects of the present application provide a memory scheduling method, device, system, storage medium, and program product for releasing idle memory of a container group to avoid wasting memory resources.

[0006] An embodiment of the present application provides a memory scheduling method, comprising: monitoring, for a container group including at least one container, actual memory usage information of an application in the at least one container; releasing a portion of the application's memory request based on the actual memory usage information of the application to obtain the application's actual memory usage; determining the container group's actual memory requirement based on the actual memory usage of each application in the container group; and adjusting the memory request allocated to the container group based on the container group's actual memory requirement.

[0007] An embodiment of the present application also provides a memory scheduling method, including: scanning the memory space requested by an application hosted in a container from its corresponding working node to obtain actual memory usage information of the application; and releasing part of the memory requested by the application based on the actual memory usage information of the application to obtain the actual memory occupancy of the application.

[0008] An embodiment of the present application further provides a memory scheduling device, comprising: a monitoring module, a release module, a determination module, and an adjustment module; the monitoring module is configured to monitor, for a container group including at least one container, actual memory usage information of an application in the at least one container; the release module is configured to release part of the memory request of the application based on the actual memory usage information of the application to obtain the actual memory usage of the application; the determination module is configured to determine the actual memory requirement of the container group based on the actual memory usage of each application in the container group; and the adjustment module is configured to adjust the memory request allocated to the container group based on the actual memory requirement of the container group.

[0009] An embodiment of the present application provides a memory scheduling system, comprising: at least one working node and a scheduling controller; at least one container group is deployed on the working node, the container group includes at least one container, and an application is run in the container; the scheduling controller is configured to monitor actual memory usage information of the application; based on the actual memory usage information of the application, release a portion of the memory request amount requested by the application from the working node to obtain the actual memory usage of the application; and, based on the actual memory usage of each application in the same container group, determine the actual memory requirement of the container group; and based on the actual memory requirement of the container group, adjust the memory request amount allocated to the container group.

[0010] An embodiment of the present application also provides an electronic device, comprising: a memory and a processor; the memory is used to store a computer program, and the processor is coupled to the memory and is used to execute the computer program to implement the steps in the above method.

[0011] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method.

[0012] An embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the above method embodiment.

[0013] In an embodiment of the present application, a memory elastic release function provided by the runtime environment hosting the application is utilized to dynamically release part of the memory request amount requested by the application from the working node to obtain the actual memory usage of the application. Furthermore, the actual memory usage of each application in the container group is used as a basis to determine the actual memory demand of the container group. Based on the actual memory demand of the container group, the memory request amount allocated to the container group is dynamically adjusted, thereby achieving elastic scaling of the container group's memory request amount, and further achieving rational utilization of memory resources, avoiding memory resource waste, and allowing the saved memory resources to be scheduled and allocated by the operating system, thereby improving memory resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0015] Figure 1a A schematic diagram of the structure of a memory scheduling system provided by an exemplary embodiment of the present application;

[0016] Figure 1b A schematic diagram of the structure of a memory scheduling system provided by an exemplary embodiment of the present application;

[0017] Figure 2 A schematic structural diagram of another memory scheduling system provided by another exemplary embodiment of the present application;

[0018] Figure 3 A schematic structural diagram of another memory scheduling system provided as yet another exemplary embodiment of the present application;

[0019] Figure 4 A schematic diagram illustrating the working relationship between various parts of a memory scheduling system provided in an exemplary embodiment of the present application;

[0020] Figure 5 A flowchart of a memory scheduling method provided by an exemplary embodiment of the present application;

[0021] Figure 6 A flowchart of another memory scheduling method provided as another exemplary embodiment of the present application;

[0022] Figure 7 A schematic structural diagram of a memory scheduling device provided by an exemplary embodiment of the present application;

[0023] Figure 8 A schematic structural diagram of another memory scheduling device provided as another exemplary embodiment of the present application;

[0024] Figure 9 A schematic structural diagram of an electronic device is provided as another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0025] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0026] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation portals for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) are in compliance with relevant laws and standards.

[0027] In the embodiments of the present application, container technology is involved. A container is an isolated environment that carries user applications. The container is deployed on a working node. The working node can be a device that can provide various resources such as computing, storage, and networking and has a certain computing power, such as a terminal device such as a computer or a mobile phone, a traditional server, a cloud server, a server cluster, and other server devices, without limitation. In addition, the embodiments of the present application do not limit the deployment environment of the container. For example, the container can not only be a container deployed in a K8S environment, but also a container implemented using other container technologies such as OpenShift (a unified platform based on Kubernetes launched by Red Hat), Docker Swarm (a container orchestration tool provided by Docker), etc. In the container environment of this embodiment, the container group is the basic deployment unit, including one or more containers. The user's application is deployed in the container. Each container in the container group shares the same resources and local network. The containers in the same container group can communicate with each other, but at the same time maintain a certain degree of isolation.

[0028] It should be noted that in the embodiments of this application, a container group refers to a collection of containers, which includes one or more containers. This collection has the same or similar functions as the container group in K8S and can implement the technical solutions of this application. Therefore, in the embodiments of this application, the collection of containers that can implement the technical solutions of this application is collectively referred to as a container group.

[0029] Among them, in the container environment of the embodiment of the present application, the memory request amount and memory limit amount are configured for the container group to limit the memory resources occupied by the container group; wherein, the container group applies for memory resources from the operating system of the working node where it is located, and the memory resources applied for by the container group are further allocated to the applications in each container. In a specific implementation, the memory request amount and memory limit amount are used to allocate resources at the container granularity. Each container can set its memory request amount and memory limit amount separately, and the sum of the memory request amounts of all containers in the container group is the memory request amount of the container group. The memory request amount of the container group is used to schedule the container group. Only when the working node has enough available memory (i.e., memory request amount) will the container group be scheduled to the working node. The memory limit amount of the container group is used to limit the upper limit of the maximum memory resources that the container group can consume.

[0030] In an embodiment of the present application, the collection strategy of the operating system of the working node determines whether the memory resources requested by the application are returned to the operating system, but the memory collection and collection strategy are all controlled by the operating system internally and are difficult to intervene externally. This will result in the idle memory of the application not being reclaimed in time, resulting in a waste of memory resources. To put it another way, even if the application can return the idle memory to the operating system, due to the limitation of the memory request amount of the container group, this part of the memory will still be occupied by the container group, and the operating system will still be unable to schedule this part of the memory for use by other container groups. As a result, even if the memory of the working node is sufficient, the resource strategy at the container group level will cause the other container groups to be unable to be deployed or use this part of the idle memory resources due to insufficient memory resources.

[0031] In response to the technical problem that when the memory resource utilization rate of the container group is low, the memory occupied by the container group cannot be released, thereby causing memory resource waste, an embodiment of the present application provides a memory scheduling method, which utilizes the memory elastic release function provided by the running environment that hosts the application for the application to dynamically release part of the memory request amount requested by the application from the working node to obtain the actual memory usage of the application; further, based on the actual memory usage of each application in the container group, the actual memory demand of the container group is determined, and according to the actual memory demand of the container group, the memory request amount allocated to the container group is dynamically adjusted, thereby achieving elastic scaling of the container group memory request amount, and then achieving rational utilization of memory resources, avoiding memory resource waste, and the saved memory resources can be used for scheduling and allocation by the operating system, thereby improving memory resource utilization.

[0032] The following, in conjunction with the accompanying drawings, details the technical solutions provided by each embodiment of the present application. Figure 1 is a schematic diagram of the structure of a memory scheduling system provided by an exemplary embodiment of the present application. This embodiment can be applied in a K8S container cluster environment to achieve memory elastic scaling of a container group, but is not limited to the K8S environment.

[0033] like Figure 1a As shown, the system 100 includes: at least one worker node 103 and a scheduling controller 101. Each worker node 103 has at least one container group deployed on it, each container group includes at least one container, and each container runs an application. For ease of description, in some descriptions of the embodiments of this application, "worker node" may be referred to as "node."

[0034] In this embodiment, the scheduling controller 101 is configured to monitor actual memory usage information of applications; release part of the memory requested by the applications from the work nodes based on the actual memory usage information of the applications to obtain the actual memory usage of the applications; determine the actual memory demand of the container group based on the actual memory usage of each application in the same container group; and adjust the memory request allocated to the container group based on the actual memory demand of the container group.

[0035] It should be noted that Figure 1a Only one working node is shown in the figure, but this does not mean that the technical solution of this application is only applicable to the case of one working node. This application does not limit the number of working nodes. Figure 1a In FIG, a container group AN is shown, each container group includes one or more containers. Figure 1a In the diagram, each container group includes container 1-container x as an example. Figure 1a In the embodiment of the present application, the memory scheduling solution for the application provided by the embodiment of the present application is illustrated by taking container 1 in container group N as an example. Other containers (such as container x) can refer to container 1, and containers in other container groups (such as container group A) can also refer to container 1 in container group N. Figure 1a Similarly, the signal flow relationship of container 1 in container group N is used as an example for description, and will not be repeated in subsequent embodiments.

[0036] Further optionally, as Figure 1b As shown, each container also runs an application's runtime environment, and the scheduling controller 101 includes: a memory management module 1012 deployed in the runtime environment, and a memory scheduling node 1011 deployed outside the container group.

[0037] In this embodiment, the operating environment of the application is the operating carrier of the application, which is responsible for providing the operating conditions and related resources for the application. The specific implementation will vary depending on the programming language used by the application. In an optional embodiment, the operating environment of the application can be implemented as a virtual machine based on the programming language, and accordingly, the application is an application implemented based on the programming language; the embodiment of the present application does not limit the type of programming language. Optionally, if the programming language is java (a widely used computer programming language), the virtual machine based on the programming language is JVM (Java Virtual Machine, Java Virtual Machine), and the application is a java program; or, optionally, if the programming language is ruby ​​(an object-oriented, imperative, functional, dynamic general-purpose programming language), the virtual machine based on the programming language is YARV (Yet another Ruby VM, a ruby-based virtual machine), and accordingly, the application is a ruby ​​program. In this embodiment of the present application, if Figure 1b As shown, a memory management module 1012 is added to the above-mentioned operating environment; the memory management module 1012 is used to monitor the actual memory usage information of the application; based on the actual memory usage information of the application, the portion of the memory application requested by the application from the working node is dynamically released to obtain the actual memory usage of the application. The "release" here refers to returning the portion of the memory application requested by the application from the working node to the OS (Operating System). Further optionally, during the operation of the application, if it is found that the memory resources are insufficient, the application can dynamically apply for memory resources from the operating system of the working node on demand. It should be noted that the total amount of memory resources applied by the application to the operating system of the working node should not exceed the memory request amount pre-configured for the container group to which the application belongs, wherein the container group will apply for memory resources from the operating system of the working node based on the memory request amount. Compared with the traditional technical solution, in the embodiment of the present application, by adding a memory management module 1012 to the operating environment of the application, the actual memory usage information of the application can be monitored, and the free memory can be dynamically released and returned to the OS.

[0038] Further, if Figure 1bAs shown, the system 100 of this embodiment further includes: a memory scheduling node 1011, which is configured to determine the actual memory requirement of the container group based on the actual memory usage of each application in the same container group. The actual memory requirement of the container group can be determined based on the actual memory capacity of all applications in the same container group. For example, it can be the sum of the actual memory capacity of all applications in the container group, or the weighted sum of the actual memory capacity of all applications in the container group, or several times the sum of the actual memory capacity of all applications in the container group, etc.; further, the memory request amount allocated to the container group is dynamically adjusted based on the actual memory capacity of the container group. In this embodiment, the memory scheduling node 1011 cooperates with the memory management module 1012. On the basis that the memory management module 1012 can dynamically release part of the memory request amount requested by the application from the working node, the memory scheduling node 1011 can dynamically adjust the memory request amount allocated to the container group. The actual memory usage of each application in the container group is used as a basis to determine the actual memory demand of the container group. Based on the actual memory demand of the container group, the memory request amount allocated to the container group is dynamically adjusted, thereby achieving elastic scaling of the container group's memory request amount, saving memory resources, and improving memory resource utilization.

[0039] In this embodiment, the memory resources that can be provided by the OS of the working node refer to the total amount of memory that can be allocated by the node; when deploying applications in a container environment, the memory request amount and memory limit amount can be configured for each container. The memory request amount is the memory size (equal to the memory request amount) requested by the application from the OS of the working node to meet its own memory needs; the memory request amount of the container group to which the application belongs refers to the sum of the memory request amounts of all containers in the container group. The memory request amount of the container group to which the application belongs is one of the important parameters considered during K8S scheduling. During scheduling, it is ensured that the memory request amounts of all container groups on the node do not exceed the memory resources that can be provided by the OS of the node.

[0040] In an optional embodiment, the application's runtime environment can also provide a parameter configuration interface, allowing users to configure relevant application parameters. Based on this, when the application starts, the application's initial memory size is reconfigured through the parameter configuration interface provided by the runtime environment. After startup, the application requests memory space from the worker nodes based on the reconfigured initial memory size; the reconfigured initial memory size is smaller than the default initial memory size. In this way, the application can attempt to find the most appropriate memory size at startup, thereby reducing memory usage.

[0041] Furthermore, in order to facilitate the acquisition of the actual memory usage information of the application, the time interval for triggering the GC (Garbage Collection) operation can also be configured for the application through the parameter configuration interface provided by its operating environment when the application is started, so as to change the GC operation from passive triggering to active triggering, thereby facilitating the statistics of the actual memory usage information of the application. Among them, passively triggering the GC operation refers to the GC operation triggered when the memory resource usage of the application reaches the default usage threshold, and actively triggering the GC operation refers to the GC operation triggered periodically according to the set time interval. Based on this, when the memory management module 1012 monitors the actual memory usage information of the application in at least one container, based on the pre-configured time interval for triggering the garbage collection GC operation, it periodically performs GC operations on the memory space applied by the application from the working node where the container group is located to obtain the actual memory usage information of the application. Optionally, the embodiment of the present application does not limit the conditions for triggering the GC operation configured through the parameter configuration interface. It can be the time interval as described above, or it can be a threshold reached by the memory usage (the set threshold is less than the default usage threshold) and other trigger conditions that can increase the execution frequency of the GC operation.

[0042] It should be noted that in the embodiments of the present application, based on the pre-configured time interval for triggering garbage collection (GC) operations, periodically performing GC operations on the memory space requested by the application from the worker node where the container group is located is a new GC operation added to the virtual machine's existing garbage collection mechanism, and the existing garbage collection mechanism can also operate normally. The existing garbage collection mechanism can be the mechanism mentioned above that passively triggers GC operations based on the default usage threshold.

[0043] The embodiment of the present application does not limit the timing of adjusting the relevant parameters through the parameter configuration interface. The adjustment can be made when the application is started, or the relevant parameters can be adjusted through the parameter configuration interface at any time during the operation of the application.

[0044] Taking an application's runtime environment as a programming language-based virtual machine (e.g., JVM) as an example, to proactively trigger garbage collection (GC) operations and increase the frequency of GC triggering, the memory management module 1012, with user authorization, modifies the user's virtual machine (e.g., JVM) parameters when the application is started, and adds some parameters so that the virtual machine proactively triggers GC operations when the virtual machine is relatively idle. The modified virtual machine (e.g., JVM) parameters include, but are not limited to, at least one of the following: garbage collection algorithm, maximum heap memory size, minimum heap memory size, and initial heap memory size. These parameters are modified to reduce the memory resources occupied by the application. The additional parameters include at least one of the following: the GC recycling cycle and recycling strategy parameters, wherein the recycling strategy parameters refer to the recycling strategy parameters that will be exposed during the execution of the garbage collection algorithm. For example, it can be a strategy parameter for determining which objects’ occupied memory resources should be recycled, or it can be a strategy parameter for determining which objects’ occupied memory resources should not be recycled. Of course, the embodiment of the present application also allows for the addition of some recycling strategy parameters. The purpose of the newly added strategy parameters is to accurately and reasonably determine the memory resources that need to be recycled by the application. On the basis of actively triggering the GC operation, the memory resources that need to be recycled by the application can be more accurately determined, thereby achieving the purpose of monitoring the actual memory usage information of the application. Among them, heap memory refers to the memory of the application written in Java language.

[0045] In this embodiment, executing the GC operation can obtain the live objects and / or dead objects marked in the application program, wherein when the object is dead (will no longer be used), the corresponding memory area should be reclaimed, and when the object is alive (may be used), it cannot be reclaimed. The present application does not limit the object survival determination algorithm. Optionally, a reference counting method can be used to track the number of references to the object by adding a reference counter to each object. Whenever a new reference is added to the object, the counter is incremented by 1. When the reference is invalidated, the counter is decremented by 1. When the counter becomes 0, it means that the object will no longer be used. In another optional embodiment, a reachability analysis algorithm can also be used. The reachability analysis algorithm is the core of the JVM garbage collection mechanism. Starting from a group of root objects called "GC Roots", it searches downward along the reference relationship. The path passed by the search process is called a reference chain. If an object has no reference chain connected to all "GC Roots", the object is considered unreachable, that is, it is determined to be dead. How to determine whether an object is alive can be a recycling policy parameter preset in the GC policy, or it can be implemented as the additional recycling policy parameter mentioned in the above embodiment.

[0046] Furthermore, the actual memory usage information of the application is obtained based on the memory space occupied by the marked live objects and / or garbage objects in the application. Optionally, the actual memory usage information may include the memory size occupied by live objects, the free memory size, and the total memory size currently requested by the application.

[0047] In this embodiment, GC operation is performed on the memory space requested by the application from the working node where the container group is located, so that the memory space occupied by the application can be regularized, that is, the memory space corresponding to the surviving objects is retained, and the memory space corresponding to the dead objects is recycled. The recycled memory space still belongs to the application and can continue to be used by the application. Of course, this part of the memory space is also part of the memory application amount of the container group to which the application belongs. However, from the perspective of improving the utilization of memory resources, it is ultimately necessary to complete the recycling of free memory at the OS level. Therefore, the memory management module 1012 is required to dynamically release part of the memory application amount of the application. It is explained here that in this embodiment of the application, recycling refers to recycling free memory to the container group level, and releasing refers to returning free memory to the OS level.

[0048] In order to return the free memory to the OS level, in an optional embodiment, the memory management module 1012 dynamically releases part of the application's memory application amount based on the application's actual memory usage information to obtain the application's actual memory occupancy, including: predicting the application's actual memory demand based on the application's actual memory usage information; determining the memory release amount when the application's actual memory demand is less than the application's current memory application amount; and calling the memory release function provided by the OS of the working node where the container group is located based on the memory release amount, returning part of the application's memory application amount to the OS to obtain the application's actual memory occupancy.

[0049] In an optional embodiment, when the memory management module 1012 predicts the actual memory demand of an application based on the actual memory usage information of the application, the following steps are performed: based on the actual memory usage information of the application, in combination with at least one of the actual memory usage of the application during a historical period, the operating pattern information of the application, the application scenario in which the application is located, and the actual memory usage information of the application during the historical period, to predict the actual memory demand of the application. For example, based on the current actual memory usage information of the application, the sum of the memory size occupied by surviving objects, the free memory size, and the current memory size can be obtained, where the free memory size is the total amount of memory that can be released. Furthermore, the actual memory usage during the historical period can be combined, and the actual memory usage can be calculated as the peak value, average value, etc. of the memory usage during the historical period. Optionally, the average value of the actual memory usage during the historical period is used to predict the actual memory demand of the application. For another example, the operating pattern information of the application during the historical period can be combined to analyze the peaks and valleys of user activity, and based on this, the memory demand changes are predicted. Peak periods generally mean more concurrent user access, resulting in a significant increase in the predicted actual memory demand of the application; conversely, during valley periods, the predicted actual memory demand of the application can be reduced. For another example, we can also combine the application scenarios of the application in the historical period. For example, if the application is an e-commerce platform and is about to have a promotion, then based on the data in the historical period, it is predicted that the actual memory demand of the application may increase by an additional 30%.

[0050] Furthermore, when determining the amount of memory to be released, if the actual memory requirement of an application is less than the current memory request of the application, a threshold may optionally be set. When the actual memory requirement of the application is less than the current memory request of the application and is also less than the threshold, the amount of memory to be released is determined. Optionally, determining the amount of memory to be released includes determining the amount of memory to be released based on at least one of the type of application, the application scenario in which the application is located, and the difference between the actual memory requirement of the application and the current memory request of the application. For example, if the application is a memory-intensive application such as a video application, a small amount of memory may be released when determining the amount of memory to be released to ensure high performance and a good user experience. For another example, if the application is an e-commerce platform and is about to launch a promotion (peak period scenario), a small amount of memory may be released to cope with the memory consumption caused by the surge in user visits during the promotion. For another example, if the difference between the actual memory requirement of the application and the current memory request of the application is large, it indicates that the memory allocated to the application is redundant, and therefore a large amount of memory may be released. Conversely, if the difference is small, it indicates that the memory allocated to the application is relatively limited, and therefore a small amount of memory may be released.

[0051] Among them, in the embodiment of the present application, the method by which the memory scheduling node 1011 obtains the actual memory usage of each application is not limited. For example, it can adopt a pull method or a push method. In actual application, different methods can be selected according to needs. Optionally, when the pull method is adopted, the memory scheduling node 1011 regularly pulls the actual memory usage of each application from the application. Optionally, when the push method is adopted, the application actively sends its actual memory usage to the memory scheduling node 1011.

[0052] In another optional embodiment, the actual memory usage of the application can also be obtained by using the indicator server, such as Figure 2 As shown, the memory scheduling system 100 also includes: an indicator server 201, which is used to collect the actual memory usage of each application on the working node, and aggregate the actual memory usage of each application in the same container group and provide it to the memory scheduling node 1011, so that the memory scheduling node 1011 can determine the actual memory requirement of the container group based on the aggregation result corresponding to the same container group. Optionally, the actual memory usage of each application in the same container group can be directly summed or weighted summed to obtain an aggregated result. It is hereby explained that any aggregation result obtained based on the actual memory usage of the application is applicable to the embodiments of the present application.

[0053] In one example, in this embodiment, the indicator server 201 stores the monitoring data of each node and provides an API for analysis and use. These monitoring data include but are not limited to the actual memory usage of each application in each container group on the working node. Specifically, an agent component and a collection component can also be deployed on the working node. The indicator server aggregates and converts the monitoring data from the agent component and the collection component, and exposes them in the form of an API for external access (such as the memory scheduling node 1011). Among them, the collection component is used to collect monitoring data about the container; the agent component is used to report relevant status information of the container group and / or the working node to the outside on the one hand, and on the other hand, it is used to receive modification information sent from the outside to modify the relevant information of the container group. For example, the memory request amount of the container group can be modified through the agent component.

[0054] In the embodiments of the present application, the method for determining the actual memory requirement of a container group based on the aggregation results corresponding to the same container group is not limited. In an alternative embodiment, the aggregation results can be multiplied by a preset coefficient to obtain the actual memory requirement of the container group, where the preset coefficient can be set based on historical experience. In another alternative embodiment, a machine learning model can be used to determine the actual memory requirement of a container group based on the aggregation results corresponding to the same container group.

[0055] Further optionally, as Figure 3 As shown, the memory scheduling system 100 may further include: a policy configuration node 301, which is used to provide a policy configuration interface for the user and receive at least one resource elasticity policy configured by the user through the policy configuration interface; the memory scheduling node 1011 is also used to obtain at least one resource elasticity policy from the policy configuration node 301, and adjust the memory request amount configured for the container group when the actual memory demand of the container group meets at least one resource elasticity policy.

[0056] In this embodiment, the configuration interface may be a command interface, a file interface, or an interactive interface (such as a web page, etc.), and this application does not impose any restrictions on this.

[0057] Among them, user-configured resource elasticity policies include: non-customized policies and customized policies; non-customized policies are a set of preset resource elasticity policies, from which users can select one or more non-customized policies through the policy interface. Non-customized policies include but are not limited to: perturbation policies and threshold policies, etc. Among them, the perturbation policy refers to determining whether the fluctuation of the actual memory demand of the container group within a set time period is within a certain fluctuation range. This policy is to ensure, for example, that the fluctuation range is set to 30%. When the fluctuation of the actual memory demand of the container group within the set time period (such as 1 hour) is less than or equal to 30%, the judgment result is yes; the threshold policy refers to determining whether the actual memory demand of the container group exceeds a certain memory safety threshold. The memory safety threshold refers to the minimum memory value to ensure system stability and avoid memory overflow. For example, if the memory safety threshold is set to 50%, when the actual memory demand of the container group exceeds 50%, the judgment result is yes. Optionally, the fluctuation range and memory safety threshold are predefined.

[0058] Compared to non-customized policies, customized policies are configured by users based on their needs. Users can configure one or more customized policies. Optionally, at least one resource elasticity policy includes at least the user's customized policy. Customized policies include manual policies and policies automatically generated based on customized policy description information. Manual policies refer to policies that can be added temporarily, allowing users to manually intervene in resource elasticity policies when necessary, thereby making immediate adjustments. In addition, when a customized policy is automatically generated based on customized policy description information, the policy description information can include policy-related information, such as setting a percentage or priority, and then the customized policy can be parsed from the policy description information. In one example, the user defines in the policy description information that the actual memory requirement of the container group is less than 20% (the set ratio) of the container group's memory request. In this case, the custom policy (referred to as the comparison policy) determines whether the actual memory requirement of the container group is no greater than 20% of the memory request currently allocated to the container group. If not, the judgment result is yes. In another example, the user defines the priority of the container group in the policy description information. In this case, the custom policy (referred to as the priority policy) determines whether the priority of the container group is lower than the set priority. If it is lower, the judgment result is yes. Generally speaking, a higher priority indicates a more important container group, and its memory request is less likely to be released.

[0059] It should be noted that both non-customized and customized policies can be used independently or in combination, and this application does not impose any restrictions on this. After the user configures at least one resource elasticity policy through the policy configuration interface, the corresponding judgment operation must be performed separately based on the at least one resource elasticity policy. If the judgment results of the judgment operations corresponding to the at least one resource elasticity policy are all yes, it is determined that the actual memory demand of the container group meets the at least one resource elasticity policy.

[0060] Furthermore, when the actual memory demand of the container group satisfies at least one resource elasticity policy, the memory request amount allocated to the container group is dynamically adjusted. Among the at least one resource elasticity policy, each resource elasticity policy is preset with a corresponding adjustment policy. In one example, at least one resource elasticity policy includes a threshold policy, and the adjustment policy corresponding to the threshold policy is to adjust the container group's request amount to be equal to the demand amount. In another example, at least one resource elasticity policy includes a comparison policy, and the adjustment policy corresponding to the comparison policy is to adjust the container group's demand amount to be greater than a set percentage of the memory request amount, while being less than the container group's memory request amount.

[0061] In the embodiments of the present application, the specific implementation method of adjusting the memory request amount configured for the container group is not limited. In one example, the system 100 of this embodiment allows the container to adjust the CPU and memory resources allocated to the container group without restarting (in-place upgrade). Based on this, when the actual memory demand of the container group meets at least one resource elasticity policy, the memory scheduling node 1011 generates an adjustment request for the workload. The adjustment request can be implemented as a Patch request. The Patch request is an HTTP request method used to apply local modifications to resources. The container group implements the scaling of the memory request amount of the application through the workload; after receiving the adjustment request (such as the Patch request), the workload modifies the memory request amount of the container group, thereby reducing the actual memory occupied by the user's container group.

[0062] In this embodiment, a rich policy extension mechanism is provided to expand the corresponding resource elasticity policy to adapt to the changing needs of users. In addition, the intervention of custom policies, especially manual policies, can ensure the stability of elastic scaling behavior.

[0063] Furthermore, an embodiment of the present application also provides a memory scheduling system 400, which is deployed in a K8S container cluster environment. The system 400 includes: at least one worker node 103 and a memory scheduling node 1011, an indicator server 201, and a policy configuration node 301. Each worker node 103 is deployed with at least one container group, each container group includes at least one container, and each container runs an application and its runtime environment JVM. The JVM is provided with a memory management module 1012.

[0064] like Figure 4 As shown, a schematic diagram of the working relationship of each part of the memory scheduling system 400. In order to highlight the function of each part, Figure 4 The inclusion relationship of each part is not limited. For example, the memory management module 1012 is extracted from the JVM and its functions are disassembled to show the functions of the memory management module 1012 in a process manner. It should also be noted that Figure 4 The memory scheduling method provided in the embodiments of the present application is illustrated using container 1 in container group N as an example. This does not mean that the memory scheduling method provided in the embodiments of the present application is only applicable to container 1 or a single container. The present application does not limit the number of container groups or the number of containers contained in each container group.

[0065] In this embodiment, based on a preset startup command, a garbage collection (GC) operation is proactively triggered, and GC operations are periodically performed on the memory space requested by the application from the working node where the container group is located, so as to obtain the actual memory usage information of the application. The time interval for triggering the GC operation is configured for the application through the parameter configuration interface provided by the JVM of its running environment when the application is started.

[0066] Furthermore, the memory management module 1012 dynamically releases part of the memory application amount of the application according to the actual memory usage information of the application to obtain the actual memory usage of the application; Figure 4 As shown in Figure 2, after step ②, the actual usage of the application is reduced.

[0067] The indicator server 201 collects the actual memory usage of the application on the working node, aggregates the actual memory usage of each application in the container group N, and provides it to the memory scheduling node 1011; after receiving the aggregation result, the memory scheduling node 1011 determines the actual memory requirement of the container group N based on the aggregation result corresponding to the container group N.

[0068] Furthermore, the memory scheduling node 1011 obtains at least one resource elasticity policy from the policy configuration node 301 and executes each resource elasticity policy (e.g. Figure 4 The disturbance strategy, threshold strategy, and custom strategy in the resource elasticity strategy are determined. If the judgment result of the judgment operation corresponding to each resource elasticity strategy is yes, it is determined that the actual memory demand of the container group N meets at least one resource elasticity strategy.

[0069] When the actual memory demand of container group N meets at least one resource elasticity policy, the memory scheduling node 1011 generates a patch request for the workload, and container group N implements the scaling of the application's memory request through the workload; after receiving the patch request, the workload modifies the memory request of container group N, thereby reducing the actual memory occupied by the user's container group N.

[0070] Figure 5 A memory scheduling method is provided in an embodiment of the present application, such as Figure 5 As shown, the method includes:

[0071] S501: For a container group including at least one container, monitor actual memory usage information of an application in at least one container;

[0072] S502: releasing part of the memory requested by the application according to the actual memory usage information of the application to obtain the actual memory usage of the application;

[0073] S503: Determine the actual memory requirement of the container group based on the actual memory usage of each application in the container group;

[0074] S504: Adjust the memory request amount allocated to the container group according to the actual memory demand of the container group.

[0075] It should be noted that the execution entities of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 501 to 502 can be the memory management module 1012 in the above system embodiment, and the execution entity of steps 503 and 504 can be the memory scheduling node 1011 in the above system embodiment; and so on.

[0076] In an optional embodiment, monitoring actual memory usage information of an application in at least one container includes: based on a pre-configured time interval for triggering garbage collection (GC) operations, periodically performing GC operations on the memory space requested by the application from the working node where the container group is located to obtain actual memory usage information of the application; wherein the time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its running environment when the application is started.

[0077] In an optional embodiment, the method further includes: when the application is started, reconfiguring the initial memory size of the application through a parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; wherein the reconfigured initial memory size is smaller than the default initial memory size.

[0078] In an optional embodiment, when releasing part of the application's memory application amount based on the application's actual memory usage information to obtain the application's actual memory occupancy, the method includes: predicting the application's actual memory demand based on the application's actual memory usage information; determining the memory release amount when the application's actual memory demand is less than the application's current memory application amount; and calling a memory release function provided by the OS of the working node where the container group is located based on the memory release amount to return part of the application's memory application amount to the OS to obtain the application's actual memory occupancy.

[0079] In an optional embodiment, when predicting the actual memory requirement of an application based on the actual memory usage information of the application, it includes: predicting the actual memory requirement of the application based on the actual memory usage information of the application, combined with the actual memory occupancy of the application in a historical period, the operating rule information of the application, the application scenario in which the application is located, and at least one of the actual memory usage information of the application in a historical period.

[0080] In an optional embodiment, when determining the memory release amount, it includes: determining the memory release amount based on at least one of the type of application, the application scenario of the application, and the difference between the actual memory demand of the application and the current memory request amount of the application.

[0081] In an optional embodiment, when determining the actual memory requirement of the container group based on the actual memory usage of each application in the container group, the method includes: obtaining memory aggregation information corresponding to the container group from an indicator server, where the memory aggregation information is obtained by aggregating the actual memory usage of each application in the container group by the indicator server; and determining the actual memory requirement of the container group based on the memory aggregation information corresponding to the container group.

[0082] In an optional embodiment, adjusting the memory request amount configured for the container group based on the actual memory demand of the container group includes: obtaining at least one resource elasticity policy preconfigured by the user; and adjusting the memory request amount configured for the container group when the actual memory demand of the container group satisfies the at least one resource elasticity policy.

[0083] In an optional embodiment, the method further includes performing at least one of the following judgment operations: when at least one resource elasticity policy includes a disturbance policy, judging whether fluctuations in the actual memory demand of the container group within a set time period are within a fluctuation range in the disturbance policy; when at least one resource elasticity policy includes a threshold policy, judging whether the actual memory demand of the container group exceeds a memory safety threshold in the threshold policy; when at least one resource elasticity policy includes a comparison policy, judging whether the actual memory demand of the container group is not greater than a set proportion of the memory request currently allocated to the container group; if the judgment results of all at least one of the above judgment operations are yes, determining that the actual memory demand of the container group satisfies at least one resource elasticity policy.

[0084] In an optional embodiment, the method further includes: in response to a configuration operation initiated by the user through a policy configuration interface, obtaining at least one resource elasticity policy configured by the user, wherein the at least one resource elasticity policy includes at least a user-defined policy.

[0085] Figure 6 A memory scheduling method is provided in an embodiment of the present application, such as Figure 6 As shown, the method includes:

[0086] S601: Scan the memory space requested by the application hosted in the container from the corresponding working node to obtain the actual memory usage information of the application;

[0087] S602: According to the actual memory usage information of the application, release part of the memory requested by the application to obtain the actual memory usage of the application.

[0088] In an optional embodiment, when scanning the memory space applied for by the application from the corresponding working node to obtain the actual memory usage information of the application, it includes: based on a pre-configured time interval for triggering garbage collection (GC) operations, periodically performing GC operations on the memory space applied for by the application from the working node where the container group is located to obtain the actual memory usage information of the application; wherein the time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its operating environment when the application is started.

[0089] In an optional embodiment, the method further includes: when the application is started, reconfiguring the initial memory size of the application through a parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; wherein the reconfigured initial memory size is smaller than the default initial memory size.

[0090] In an optional embodiment, when releasing part of the application's memory application amount based on the application's actual memory usage information to obtain the application's actual memory occupancy, the method includes: predicting the application's actual memory demand based on the application's actual memory usage information; determining the memory release amount when the application's actual memory demand is greater than the application's current memory application amount; and calling a memory release function provided by the OS of the working node where the container group is located based on the memory release amount to return part of the application's memory application amount to the OS to obtain the application's actual memory occupancy.

[0091] In an optional embodiment, the method further includes: during the application's execution, if the application's actual memory demand exceeds the application's actual memory usage, dynamically requesting memory space from the worker node. It should be noted that this request is made by the application to the worker node, not by the memory management module 1012.

[0092] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.

[0093] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The sequence numbers of the operations, such as 501, 502, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to be different types.

[0094] Figure 7 A memory scheduling device is provided as an exemplary embodiment of the present application, such as Figure 7 As shown, the memory scheduling device 700 includes: a monitoring module 71, a release module 72, a determination module 73 and an adjustment module 74;

[0095] A monitoring module 71 is configured to monitor, for a container group including at least one container, actual memory usage information of an application in the at least one container;

[0096] A release module 72 is configured to release part of the memory application of the application according to the actual memory usage information of the application to obtain the actual memory usage of the application;

[0097] A determination module 73 determines an actual memory requirement of the container group based on the actual memory usage of each application in the container group;

[0098] The adjustment module 74 is configured to adjust the memory request amount allocated to the container group according to the actual memory requirement of the container group.

[0099] In an optional embodiment, when the monitoring module 71 monitors the actual memory usage information of an application in at least one container, it is specifically used to: based on a pre-configured time interval for triggering garbage collection (GC) operations, periodically perform GC operations on the memory space requested by the application from the working node where the container group is located to obtain the actual memory usage information of the application; wherein the time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its running environment when the application is started.

[0100] In an optional embodiment, the adjustment module 74 is also used to: when the application is started, reconfigure the initial memory size of the application through the parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; wherein the reconfigured initial memory size is smaller than the default initial memory size.

[0101] In an optional embodiment, when the release module 72 releases part of the memory application amount of the application according to the actual memory usage information of the application to obtain the actual memory occupancy of the application, it is specifically used to: predict the actual memory requirement of the application according to the actual memory usage information of the application; determine the memory release amount when the actual memory requirement of the application is less than the current memory application amount of the application; and call the memory release function provided by the OS of the working node where the container group is located according to the memory release amount, and return part of the memory application amount of the application to the OS to obtain the actual memory occupancy of the application.

[0102] In an optional embodiment, when the release module 72 predicts the actual memory requirement of the application based on the actual memory usage information of the application, it is specifically used to: predict the actual memory requirement of the application based on the actual memory usage information of the application, combined with the actual memory occupancy of the application in a historical period, the operating rule information of the application, the application scenario in which the application is located, and at least one of the actual memory usage information of the application in a historical period.

[0103] In an optional embodiment, when determining the amount of memory released, the release module 72 is specifically used to: determine the amount of memory released based on at least one of the type of the application, the application scenario in which the application is located, and the difference between the actual memory requirement of the application and the current memory request amount of the application.

[0104] In an optional embodiment, when determining the actual memory requirement of the container group based on the actual memory usage of each application in the container group, the determination module 73 is specifically configured to: obtain memory aggregation information corresponding to the container group from an indicator server, where the memory aggregation information is obtained by aggregating the actual memory usage of each application in the container group by the indicator server; and determine the actual memory requirement of the container group based on the memory aggregation information corresponding to the container group.

[0105] In an optional embodiment, when adjusting the memory request amount configured for the container group based on the actual memory demand of the container group, the adjustment module 74 includes: obtaining at least one resource elasticity policy preconfigured by the user; and dynamically adjusting the memory request amount configured for the container group if the actual memory demand of the container group satisfies the at least one resource elasticity policy.

[0106] In an optional embodiment, the adjustment module 74 is further configured to perform at least one of the following judgment operations: when the at least one resource elasticity policy includes a disturbance policy, determining whether fluctuations in the actual memory demand of the container group within a set time period are within a fluctuation range in the disturbance policy; when the at least one resource elasticity policy includes a threshold policy, determining whether the actual memory demand of the container group exceeds a memory safety threshold in the threshold policy; when the at least one resource elasticity policy includes a comparison policy, determining whether the actual memory demand of the container group is not greater than a set proportion of the memory request currently allocated to the container group; if the judgment result of all at least one of the above judgment operations is yes, determining that the actual memory demand of the container group satisfies the at least one resource elasticity policy.

[0107] In an optional embodiment, the adjustment module 74 is further configured to: respond to a configuration operation initiated by the user through the policy configuration interface, and obtain at least one resource elasticity policy configured by the user, wherein the at least one resource elasticity policy includes at least a user-defined policy.

[0108] Figure 8 A memory scheduling device is provided in an embodiment of the present application, such as Figure 8 As shown, the memory scheduling device 800 includes: a scanning module 81 and a release module 82;

[0109] A scanning module 81 is configured to scan the memory space requested by the application hosted in the container from the corresponding working node to obtain actual memory usage information of the application;

[0110] The release module 82 is configured to release part of the memory application amount of the application program according to the actual memory usage information of the application program, so as to obtain the actual memory usage of the application program.

[0111] In an optional embodiment, when scanning the memory space requested by the application from the corresponding working node to obtain the actual memory usage information of the application, the scanning module 81 is specifically used to: based on a pre-configured time interval for triggering garbage collection (GC) operations, periodically perform GC operations on the memory space requested by the application from the working node where the container group is located to obtain the actual memory usage information of the application; wherein the time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its operating environment when the application is started.

[0112] In an optional embodiment, the release module 82 is also used to: when the application is started, reconfigure the initial memory size of the application through the parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; wherein the reconfigured initial memory size is smaller than the default initial memory size.

[0113] In an optional embodiment, when the release module 82 releases part of the memory application amount of the application according to the actual memory usage information of the application to obtain the actual memory occupancy of the application, it is specifically used to: predict the actual memory requirement of the application according to the actual memory usage information of the application; determine the memory release amount when the actual memory requirement of the application is greater than the current memory application amount of the application; and call the memory release function provided by the OS of the working node where the container group is located according to the memory release amount, and return part of the memory application amount of the application to the OS to obtain the actual memory occupancy of the application.

[0114] In an optional embodiment, the memory scheduling device 800 also includes an application module, which is specifically used to: during the operation of the application, if the actual memory demand of the application is greater than the actual memory occupancy of the application, dynamically apply for memory space from the working node.

[0115] Figure 9 This is a structural diagram of an electronic device provided by another exemplary embodiment of the present application. Figure 9 As shown, the electronic device includes a memory 94 and a processor 95 .

[0116] Memory 94 is used to store computer programs and may be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, images, videos, etc.

[0117] The memory 94 may be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0118] The processor 95 is coupled to the memory 94 and is configured to execute a computer program in the memory 94 to: monitor, for a container group including at least one container, actual memory usage information of an application in the at least one container; release a portion of the memory requested by the application based on the actual memory usage information of the application to obtain the actual memory usage of the application; determine the actual memory requirement of the container group based on the actual memory usage of each application in the container group; and adjust the memory request allocated to the container group based on the actual memory requirement of the container group.

[0119] In an optional embodiment, when the processor 95 receives the actual memory usage information of an application in at least one container, it is specifically configured to: periodically perform a GC operation on the memory space requested by the application from the working node where the container group is located based on a pre-configured time interval for triggering a garbage collection (GC) operation, so as to obtain the actual memory usage information of the application; wherein the time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its running environment when the application is started.

[0120] In an optional embodiment, the processor 95 is also used to: when the application is started, reconfigure the initial memory size of the application through the parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; wherein the reconfigured initial memory size is smaller than the default initial memory size.

[0121] In an optional embodiment, when the processor 95 releases part of the memory application amount of the application based on the actual memory usage information of the application to obtain the actual memory occupancy of the application, it is specifically used to: predict the actual memory requirement of the application based on the actual memory usage information of the application; determine the memory release amount when the actual memory requirement of the application is less than the current memory application amount of the application; and call the memory release function provided by the OS of the working node where the container group is located based on the memory release amount, and return part of the memory application amount of the application to the OS to obtain the actual memory occupancy of the application.

[0122] In an optional embodiment, when the processor 95 predicts the actual memory requirement of the application based on the actual memory usage information of the application, it is specifically used to: predict the actual memory requirement of the application based on the actual memory usage information of the application, combined with the actual memory occupancy of the application in a historical period, the operating rule information of the application, the application scenario in which the application is located, and at least one of the actual memory usage information of the application in a historical period.

[0123] In an optional embodiment, when determining the amount of memory released, the processor 95 is specifically used to: determine the amount of memory released based on at least one of the type of the application, the application scenario in which the application is located, and the difference between the actual memory requirement of the application and the current memory request amount of the application.

[0124] In an optional embodiment, when determining the actual memory requirement of the container group based on the actual memory usage of each application in the container group, the processor 95 is specifically configured to: obtain memory aggregation information corresponding to the container group from an indicator server, where the memory aggregation information is obtained by aggregating the actual memory usage of each application in the container group by the indicator server; and determine the actual memory requirement of the container group based on the memory aggregation information corresponding to the container group.

[0125] In an optional embodiment, when the processor 95 adjusts the memory request amount configured for the container group based on the actual memory demand of the container group, the processor 95 includes: obtaining at least one resource elasticity policy preconfigured by the user; and dynamically adjusting the memory request amount configured for the container group when the actual memory demand of the container group satisfies the at least one resource elasticity policy.

[0126] In an optional embodiment, the processor 95 is further configured to perform at least one of the following judgment operations: when the at least one resource elasticity policy includes a disturbance policy, determining whether a fluctuation in the actual memory demand of the container group within a set time period is within a fluctuation range in the disturbance policy; when the at least one resource elasticity policy includes a threshold policy, determining whether the actual memory demand of the container group exceeds a memory safety threshold in the threshold policy; when the at least one resource elasticity policy includes a comparison policy, determining whether the actual memory demand of the container group is not greater than a set proportion of the memory request currently allocated to the container group; if the judgment result of all at least one of the above judgment operations is yes, determining that the actual memory demand of the container group satisfies the at least one resource elasticity policy.

[0127] In an optional embodiment, the processor 95 is further configured to: respond to a configuration operation initiated by a user through a policy configuration interface, and obtain at least one resource elasticity policy configured by the user, wherein the at least one resource elasticity policy includes at least a user-defined policy.

[0128] Further, if Figure 9 As shown, the electronic device also includes: a communication component 96, a display 97, a power component 98, an audio component 99 and other components. Figure 9 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 9 In addition, Figure 9 The components in the dotted box are optional components, not mandatory components, and the specific components depend on the product form of the working node. The working node of this embodiment can be implemented as a terminal device such as a desktop computer, laptop computer, smart phone or IOT device, or a server device such as a conventional server, cloud server or server array. If the working node of this embodiment is implemented as a terminal device such as a desktop computer, laptop computer, smart phone, etc., it can include Figure 9 If the working node of this embodiment is implemented as a server device such as a conventional server, a cloud server or a server array, it may not include Figure 9 Components within the dotted box.

[0129] The embodiment of the present application also provides an electronic device, the implementation structure of the electronic device is similar to Figure 9 The implementation structure of the electronic device shown is the same or similar, and can be referred to Figure 9 The electronic device provided in this embodiment is implemented as follows: Figure 9 The electronic devices in the illustrated embodiments differ primarily in the functions implemented by the processors executing computer programs stored in memory. In the electronic devices provided in this embodiment, the processors executing computer programs stored in memory can be used to: scan the memory space requested by applications hosted in containers from their respective work nodes to obtain information about the actual memory usage of the applications; and, based on the actual memory usage information of the applications, release a portion of the memory requested by the applications to obtain information about the actual memory usage of the applications.

[0130] In an optional embodiment, when the processor scans the memory space applied for by the application from the corresponding working node to obtain the actual memory usage information of the application, the processor is specifically used to: based on a pre-configured time interval for triggering garbage collection (GC) operations, periodically perform GC operations on the memory space applied for by the application from the working node where the container group is located to obtain the actual memory usage information of the application; wherein the time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its operating environment when the application is started.

[0131] In an optional embodiment, the processor is also used to: when the application is started, reconfigure the initial memory size of the application through the parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; wherein the reconfigured initial memory size is smaller than the default initial memory size.

[0132] In an optional embodiment, when the processor releases part of the memory application amount of the application based on the actual memory usage information of the application to obtain the actual memory occupancy of the application, it is specifically used to: predict the actual memory requirement of the application based on the actual memory usage information of the application; determine the memory release amount when the actual memory requirement of the application is greater than the current memory application amount of the application; and call the memory release function provided by the OS of the working node where the container group is located based on the memory release amount, and return part of the memory application amount of the application to the OS to obtain the actual memory occupancy of the application.

[0133] In an optional embodiment, the processor is further configured to: during the running of the application, if the actual memory requirement of the application is greater than the actual memory usage of the application, dynamically apply for memory space from the working node.

[0134] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.

[0135] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is enabled to implement each step in the above method embodiment.

[0136] Accordingly, an embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the above method embodiment.

[0137] The above-mentioned memory can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0138] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology and other technologies.

[0139] The above-mentioned display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundary of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0140] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.

[0141] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0142] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) that contain computer-usable program code.

[0143] The present application is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.

[0144] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0146] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.

[0147] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0148] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0149] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0150] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A memory scheduling method, characterized in that: include: For a container group including at least one container, monitor actual memory usage information of an application in the at least one container; According to the actual memory usage information of the application, releasing part of the memory application amount of the application to obtain the actual memory usage of the application; Determine the actual memory requirement of the container group based on the actual memory usage of each application in the container group; Adjust the memory request amount allocated to the container group according to the actual memory demand of the container group.

2. The method according to claim 1, characterized in that Monitoring actual memory usage information of an application in the at least one container includes: Based on a pre-configured time interval for triggering a garbage collection (GC) operation, periodically perform a GC operation on the memory space requested by the application from the working node where the container group is located, so as to obtain actual memory usage information of the application; The time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its running environment when the application is started.

3. The method according to claim 2, characterized in that Also includes: When the application is started, the initial memory size of the application is reconfigured through the parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; The reconfigured initial memory size is smaller than the default initial memory size.

4. The method according to claim 1, wherein Releasing part of the memory application amount of the application according to the actual memory usage information of the application to obtain the actual memory usage of the application, including: Predicting actual memory requirements of the application based on actual memory usage information of the application; determining a memory release amount when the actual memory demand of the application is less than the current memory request of the application; According to the memory release amount, a memory release function provided by the OS of the working node where the container group is located is called to return part of the memory application amount of the application to the OS to obtain the actual memory usage of the application.

5. The method according to claim 4, characterized in that Predicting the actual memory requirement of the application based on the actual memory usage information of the application includes: Based on the actual memory usage information of the application, combined with the actual memory occupancy of the application in a historical period, the operating rule information of the application, the application scenario in which the application is located, and at least one of the actual memory usage information of the application in a historical period, the actual memory requirement of the application is predicted.

6. The method according to claim 1, characterized in that Determining the actual memory requirement of the container group based on the actual memory usage of each application in the container group includes: Obtaining memory aggregation information corresponding to the container group from the indicator server, where the memory aggregation information is obtained by aggregating the actual memory usage of each application in the container group by the indicator server; An actual memory requirement of the container group is determined according to the memory aggregation information corresponding to the container group.

7. The method according to any one of claim 6, characterized in that Adjusting the memory request amount allocated to the container group according to the actual memory requirement of the container group includes: Obtain at least one resource elasticity policy pre-configured by the user; When the actual memory requirement of the container group satisfies the at least one resource elasticity policy, the memory request amount allocated to the container group is adjusted.

8. The method according to claim 7, characterized in that It also includes performing at least one of the following judgment operations: In a case where the at least one resource elasticity policy includes a perturbation policy, determining whether fluctuations in actual memory demand of the container group within a set time period are within a fluctuation range in the perturbation policy; In a case where the at least one resource elasticity policy includes a threshold policy, determining whether the actual memory demand of the container group exceeds a memory safety threshold in the threshold policy; In a case where the at least one resource elasticity policy includes a comparison policy, determining whether the actual memory demand of the container group is not greater than a set proportion of the memory request currently allocated to the container group; If the judgment results of the at least one judgment operation are all yes, it is determined that the actual memory demand of the container group meets the at least one resource elasticity policy.

9. The method according to claim 7, characterized in that Also includes: In response to a configuration operation initiated by a user through a policy configuration interface, at least one resource elasticity policy configured by the user is acquired, where the at least one resource elasticity policy includes at least a user-defined policy.

10. A memory scheduling method, characterized in that: include: Scan the memory space requested by the application hosted in the container from the corresponding working node to obtain the actual memory usage information of the application; According to the actual memory usage information of the application, part of the memory application amount of the application is released to obtain the actual memory usage of the application.

11. The method according to claim 10, characterized in that Scan the memory space requested by the application from the corresponding working node to obtain the actual memory usage information of the application, including: Based on a pre-configured time interval for triggering a garbage collection (GC) operation, periodically perform a GC operation on the memory space requested by the application from the working node where the container group is located, so as to obtain actual memory usage information of the application; The time interval for triggering the GC operation is configured for the application through a parameter configuration interface provided by its running environment when the application is started.

12. The method according to any one of claims 10-11, characterized in that Also includes: When the application is started, the initial memory size of the application is reconfigured through the parameter configuration interface, so that the application applies for memory space from the working node according to the reconfigured initial memory size after startup; The reconfigured initial memory size is smaller than the default initial memory size.

13. A memory scheduling system, characterized in that: include: At least one working node and a scheduling controller; at least one container group is deployed on the working node, the container group includes at least one container, and an application is running in the container; The scheduling controller is used to monitor the actual memory usage information of the application; According to the actual memory usage information of the application, releasing part of the memory requested by the application from the working node to obtain the actual memory usage of the application; and, determining the actual memory requirement of the container group based on the actual memory usage of each application in the same container group; Adjust the memory request amount allocated to the container group according to the actual memory demand of the container group.

14. The system according to claim 13, wherein: The container also runs an operating environment of an application program, and the scheduling controller includes: a memory management module deployed in the operating environment, and a memory scheduling node deployed outside the container group; The memory management module is configured to monitor actual memory usage information of the application program; and release part of the memory application amount requested by the application program from the working node according to the actual memory usage information of the application program, so as to obtain the actual memory usage of the application program; The memory scheduling node is configured to determine the actual memory requirement of the container group based on the actual memory usage of each application in the same container group; and adjust the memory request amount allocated to the container group based on the actual memory requirement of the container group.

15. The system according to claim 14, wherein: Also includes: The indicator server is used to collect the actual memory usage of each application on the working node, aggregate the actual memory usage of each application in the same container group, and provide it to the memory scheduling node, so that the memory scheduling node can determine the actual memory requirement of the container group based on the aggregation results corresponding to the same container group.

16. The system according to claim 14 or 15, characterized in that Also includes: A policy configuration node, configured to provide a policy configuration interface for users and receive at least one resource elasticity policy configured by the user through the policy configuration interface; The memory scheduling node is specifically configured to obtain the at least one resource elasticity policy from the policy configuration node, and adjust the memory request amount configured for the container group if the actual memory demand of the container group meets the at least one resource elasticity policy.

17. An electronic device, characterized in that: include: memory and processor; The memory is used to store a computer program, and the processor is coupled to the memory and is used to execute the computer program in the memory to implement the steps in the method according to any one of claims 1 to 12.

18. A computer-readable storage medium storing a computer program / instruction, characterized in that: When the computer program is executed by a processor, the processor is enabled to implement the steps of the method according to any one of claims 1 to 12.

19. A computer program product, characterized in that include: A computer program / instruction, when executed by a processor, causes the processor to implement the steps of the method according to any one of claims 1 to 12.