Memory management method and memory management device

By predicting the memory usage and latency sensitivity of the virtual machine based on similarity, and preallocating memory dynamically, the problem of resource waste and latency-sensitive requirements management in virtual machine memory management is solved, and efficient memory utilization and performance optimization is achieved.

CN119669113APending Publication Date: 2025-03-21SAMSUNG (CHINA) SEMICONDUCTOR CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411764788.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The prior art has waste of resources in the memory management of virtual machines, especially memory idle problems caused by static allocation, and it is difficult to effectively predict and manage latency-sensitive virtual machine memory requirements.

Method used

Dynamically preallocate memory by predicting the unused memory values ​​and latency sensitivity of the virtual machines to be allocated based on similarity, ensuring that latency-sensitive virtual machines prioritize local memory and preallocate non-latency-sensitive memory into pool memory.

Benefits of technology

Effectively reduces memory idleness, improves memory utilization, ensures performance optimization of latency-sensitive virtual machines, and saves local memory storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669113A_ABST
    Figure CN119669113A_ABST
Patent Text Reader

Abstract

The invention provides a memory management method and a memory management device. The memory management method comprises the steps of predicting an unused memory value and / or delay sensitivity of a second virtual machine to be distributed with a memory based on an unused memory value and / or delay sensitivity of at least one first virtual machine distributed with the memory, the delay sensitivity of the respective virtual machine indicates whether the respective virtual machine is sensitive to delay based on whether a delay condition indicating that the respective virtual machine is sensitive to delay is satisfied; and pre-allocating the to-be-allocated memory of the second virtual machine based on the predicted unused memory value and / or delay sensitivity of the second virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present embodiment relates to computer technology, and more specifically, to a memory management method and a memory management device. Background Art

[0002] A virtual machine (VM) is a virtual environment created on a physical hardware system. A virtual machine simulates its own set of virtualized hardware including a central processing unit (CPU), memory, network interfaces, and storage.

[0003] In order to better use the virtual machine, the entire memory address space of the virtual machine is usually statically pre-allocated. Therefore, the server can allocate the maximum amount of memory to the virtual machine as needed. However, a large part of the memory of the virtual machine may not be accessed, and even when the memory is accessed, only a part of the memory may be frequently accessed. Summary of the invention

[0004] According to one aspect of the present disclosure, a memory management method includes: predicting an unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated based on an unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated, wherein the delay sensitivity of the corresponding virtual machine indicates whether the corresponding virtual machine is sensitive to delay based on whether a delay condition indicating that the corresponding virtual machine is sensitive to delay is satisfied; and pre-allocating the memory to be allocated of the second virtual machine based on the predicted unused memory value and / or delay sensitivity of the second virtual machine.

[0005] According to one aspect of the present disclosure, the step of predicting the unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated includes: determining at least one similarity between the memory usage information of the at least one first virtual machine and the memory usage information of the second virtual machine, wherein the memory usage information of the corresponding virtual machine includes one or more of the identity of the customer corresponding to the corresponding virtual machine, the application type corresponding to the corresponding virtual machine, the location of the customer, information of the processor specified by the corresponding virtual machine, and information of the memory specified by the corresponding virtual machine; based on the at least one similarity and the unused memory value and / or delay sensitivity of the at least one first virtual machine, predicting the unused memory value and / or delay sensitivity of the second virtual machine.

[0006] According to one aspect of the present disclosure, the one or more first virtual machines include n first virtual machines, where n is a positive integer, and the step of predicting the unused memory value of the second virtual machine includes: assigning n weights to the n unused memory values ​​of the n first virtual machines based on n similarities between n pieces of memory usage information of the n first virtual machines and memory usage information of the second virtual machine; and predicting the estimated value of unused memory of the second virtual machine by performing a weighted average calculation based on the n unused memory values ​​of the n first virtual machines and the n weights corresponding to the n unused memory values.

[0007] According to one aspect of the present disclosure, the step of predicting the delay sensitivity of the second virtual machine to which memory is to be allocated includes: in response to the similarity indicating that the memory usage information of the second virtual machine is the same as the memory usage information of one or more first virtual machines among the at least one first virtual machine, determining whether the one or more first virtual machines are sensitive to delay; in response to the number of delay-sensitive first virtual machines among the one or more first virtual machines being greater than or equal to half of the number of the one or more first virtual machines, predicting the delay sensitivity of the second virtual machine as delay-sensitive, and; in response to the number of delay-sensitive first virtual machines among the one or more first virtual machines being less than half of the number of the one or more first virtual machines, predicting the delay sensitivity of the second virtual machine as insensitive to delay.

[0008] According to one aspect of the present disclosure, the step of pre-allocating memory to be allocated of a second virtual machine includes: in response to only the delay sensitivity of an unused memory value and a delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is sensitive to delay, pre-allocating the memory to be allocated of the second virtual machine into a local memory; in response to only the unused memory value of an unused memory value and a delay sensitivity being predicted, pre-allocating predicted unused memory of the memory to be allocated of the second virtual machine corresponding to the predicted unused memory value of the second virtual machine into a pool memory, and pre-allocating the remaining memory of the memory to be allocated of the second virtual machine except the predicted unused memory into a local memory; and / or in response to both the unused memory value and the delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is not sensitive to delay, pre-allocating predicted unused memory of the memory to be allocated of the second virtual machine into a pool memory, and pre-allocating the remaining memory of the memory to be allocated of the second virtual machine except the predicted unused memory into a local memory.

[0009] According to one aspect of the present disclosure, the memory management method also includes: determining whether the unused memory in the allocated memory of the second virtual machine is overestimated by comparing the actual unused memory of the second virtual machine monitored when the second virtual machine is running with the unused memory in the allocated memory of the second virtual machine; in response to determining that the unused memory in the allocated memory of the second virtual machine is overestimated, estimating whether the second virtual machine is sensitive to delay; and in response to the second virtual machine being estimated to be sensitive to delay; reallocating the unused memory of the second virtual machine to the local memory.

[0010] According to one aspect of the present disclosure, an operation of estimating whether a second virtual machine is sensitive to delay includes: obtaining a core performance measurement unit indicator of at least one first virtual machine and a core performance measurement unit indicator of a second virtual machine; determining N virtual machines among the at least one first virtual machine that are most similar to the second virtual machine in delay-related information by comparing the core performance measurement unit indicator of the at least one first virtual machine and the core performance measurement unit indicator of the second virtual machine, wherein N is a positive integer; and determining whether the second virtual machine is sensitive to delay based on determining whether a proportion of virtual machines among the N virtual machines that have a delay-sensitive label is greater than or equal to a threshold.

[0011] According to one aspect of the present disclosure, the memory management method also includes: in response to the second virtual machine being estimated to be insensitive to latency; clustering the data stored in the local memory of the second virtual machine into multiple groups based on the program context and one or more access times of the application on the second virtual machine; storing one or more groups with the least average access times among the multiple groups in the pool memory and / or storing one or more groups with the largest average access times among the multiple groups in the local memory.

[0012] According to one aspect of the present disclosure, the at least one first virtual machine is n virtual machines among multiple first virtual machines to which memory has been allocated, having memory usage information that is most similar to the memory usage information of the second virtual machine, wherein n is a positive integer, and wherein the memory usage information of the virtual machine includes one or more of the identity of the customer corresponding to the virtual machine, the type of application corresponding to the virtual machine, the location of the customer, information of the processor specified by the virtual machine, and information of the memory specified by the virtual machine.

[0013] According to one aspect of the present disclosure, a memory management device includes: a memory storing one or more instructions; and a processor operably coupled to the memory and configured to execute the one or more instructions, wherein when the processor executes the one or more instructions, the processor is configured to: predict an unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated based on an unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated, wherein the delay sensitivity of the virtual machine indicates whether the virtual machine is sensitive to delay based on whether a delay condition indicating that the corresponding virtual machine is sensitive to delay is satisfied; and pre-allocate the memory to be allocated of the second virtual machine based on the predicted unused memory value and / or delay sensitivity of the second virtual machine.

[0014] According to one aspect of the present disclosure, when the one or more instructions are executed by a processor to predict the unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated, the processor is caused to: determine at least one similarity between the memory usage information of at least one first virtual machine and the memory usage information of the second virtual machine, wherein the memory usage information of the corresponding virtual machine includes one or more of the identity of the customer corresponding to the corresponding virtual machine, the application type corresponding to the corresponding virtual machine, the location of the customer, the information of the processor specified by the corresponding virtual machine, and the information of the memory specified by the corresponding virtual machine; and predict the unused memory value and / or delay sensitivity of the second virtual machine based on the at least one similarity and the unused memory value and / or delay sensitivity of at least one first virtual machine.

[0015] According to one aspect of the present disclosure, the one or more first virtual machines include n first virtual machines, wherein n is a positive integer, and wherein the one or more instructions, when executed by a processor to predict the unused memory value of a second virtual machine, cause the processor to: assign n weights to the n unused memory values ​​of the n first virtual machines based on n similarities between n pieces of memory usage information of the n first virtual machines and memory usage information of the second virtual machine, respectively; and predict the estimated unused memory value of the second virtual machine by performing a weighted average calculation based on the n unused memory values ​​of the n first virtual machines and the n weights corresponding to the n unused memory values.

[0016] According to one aspect of the present disclosure, when the one or more instructions are executed by a processor to predict the delay sensitivity of a second virtual machine, the processor is caused to: determine whether the one or more first virtual machines are sensitive to delay in response to the similarity indicating that memory usage information of the second virtual machine is the same as memory usage information of one or more first virtual machines among the at least one first virtual machine; predict the delay sensitivity of the second virtual machine as being sensitive to delay in response to the number of delay-sensitive first virtual machines among the one or more first virtual machines being greater than or equal to half of the number of the one or more first virtual machines, and; predict the delay sensitivity of the second virtual machine as being insensitive to delay in response to the number of delay-sensitive first virtual machines among the one or more first virtual machines being less than half of the number of the one or more first virtual machines.

[0017] According to one aspect of the present disclosure, the one or more instructions, when executed by a processor to pre-allocate memory to be allocated of a second virtual machine, cause the processor to: in response to only the delay sensitivity of the unused memory value and the delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is sensitive to delay, pre-allocate the memory to be allocated of the second virtual machine into the local memory; in response to only the unused memory value of the unused memory value and the delay sensitivity being predicted, pre-allocate the predicted unused memory of the memory to be allocated of the second virtual machine corresponding to the predicted unused memory value of the second virtual machine into the pool memory, and pre-allocate the remaining memory of the memory to be allocated of the second virtual machine except the predicted unused memory into the local memory; and / or in response to both the unused memory value and the delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is not sensitive to delay, pre-allocate the predicted unused memory of the memory to be allocated of the second virtual machine into the pool memory, and pre-allocate the remaining memory of the memory to be allocated of the second virtual machine except the predicted unused memory into the local memory.

[0018] According to one aspect of the present disclosure, the one or more instructions, when executed by a processor, cause the processor to: determine whether the unused memory in the allocated memory of the second virtual machine is overestimated by comparing the actual unused memory of the second virtual machine monitored when the second virtual machine is running with the unused memory in the allocated memory of the second virtual machine; in response to determining that the unused memory in the allocated memory of the second virtual machine of the second virtual machine is overestimated, estimate whether the second virtual machine is sensitive to latency; and in response to the second virtual machine being estimated to be sensitive to latency; reallocate the unused memory of the second virtual machine to local memory.

[0019] According to one aspect of the present disclosure, the one or more instructions, when executed by a processor to estimate whether the second virtual machine is sensitive to delay, cause the processor to: obtain a core performance measurement unit indicator of the at least one first virtual machine and a core performance measurement unit indicator of the second virtual machine; determine the N virtual machines among the at least one first virtual machine that are most similar to the second virtual machine in delay-related information by comparing the core performance measurement unit indicator of the at least one first virtual machine and the core performance measurement unit indicator of the second virtual machine, wherein N is a positive integer; and determine whether the second virtual machine is sensitive to delay based on determining whether the proportion of virtual machines among the N virtual machines with a delay-sensitive label is greater than or equal to a threshold.

[0020] According to one aspect of the present disclosure, the one or more instructions, when executed by a processor, cause the processor to: in response to the second virtual machine being estimated to be insensitive to latency; cluster the data stored in the local memory of the second virtual machine into multiple groups based on the program context and the number of accesses of the application on the second virtual machine; store one or more groups with the least average number of accesses among the multiple groups in the pool memory and / or store one or more groups with the greatest average number of accesses among the multiple groups in the local memory.

[0021] According to one aspect of the present disclosure, the at least one first virtual machine is n virtual machines among multiple first virtual machines to which memory has been allocated that have memory usage information that is most similar to the memory usage information of the second virtual machine, wherein n is a positive integer, and wherein the memory usage information of the virtual machine includes one or more of the identity of the customer corresponding to the virtual machine, the type of application corresponding to the virtual machine, the location of the customer, information of the processor specified by the virtual machine, and information of the memory specified by the virtual machine.

[0022] According to one aspect of the present disclosure, a computer-readable storage medium having instructions is provided, wherein the instructions are stored in the computer-readable storage medium. When the instructions are executed by a processor, the processor is caused to execute a method, wherein the method comprises: predicting an unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated based on an unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated, wherein the delay sensitivity of the corresponding virtual machine indicates whether the corresponding virtual machine is sensitive to delay based on whether a delay condition indicating that the corresponding virtual machine is sensitive to delay is satisfied; and pre-allocating the memory to be allocated of the second virtual machine based on the predicted unused memory value and / or delay sensitivity of the second virtual machine.

[0023] According to one aspect of the present disclosure, the step of predicting the unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated includes: determining at least one similarity between the memory usage information of the at least one first virtual machine and the memory usage information of the second virtual machine, wherein the memory usage information of the corresponding virtual machine includes one or more of the identity of the customer corresponding to the corresponding virtual machine, the application type corresponding to the corresponding virtual machine, the location of the customer, information of the processor specified by the corresponding virtual machine, and information of the memory specified by the corresponding virtual machine; based on the at least one similarity and the unused memory value and / or delay sensitivity of the at least one first virtual machine, predicting the unused memory value and / or delay sensitivity of the second virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other objects and features of the present embodiment will become more apparent from the following description taken in conjunction with the accompanying drawings which illustrate examples.

[0025] Figure 1 A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0026] Figure 2 A flowchart showing a method for predicting an unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated according to an exemplary embodiment of the present disclosure is shown.

[0027] Figure 3 A flowchart showing a method for predicting delay sensitivity of a second virtual machine to which memory is to be allocated according to an exemplary embodiment of the present disclosure is shown.

[0028] Figure 4 A flowchart showing a method of pre-allocating memory to be allocated of a second virtual machine according to an exemplary embodiment of the present disclosure.

[0029] Figure 5 A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0030] Figure 6 A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0031] Figure 7 A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0032] Figure 8 A schematic diagram showing a virtual machine server according to an example embodiment of the present disclosure.

[0033] Fig. 9 A schematic diagram showing a memory management method according to an example embodiment of the present disclosure.

[0034] Fig.10A schematic diagram showing memory pre-allocation according to an example embodiment of the present disclosure.

[0035] Fig.11 A schematic diagram showing a similarity-based unused memory estimation method according to an example embodiment of the present disclosure is shown.

[0036] Fig.12 A schematic diagram illustrating memory reallocation and group-based data exchange according to an example embodiment of the present disclosure.

[0037] Fig.13 A schematic diagram illustrating estimating the sensitivity of a virtual machine according to an example embodiment of the present disclosure.

[0038] Fig.14 A schematic diagram illustrating group-based data exchange according to an example embodiment of the present disclosure.

[0039] Fig.15 A schematic diagram illustrating clustering data into groups according to an example embodiment of the present disclosure.

[0040] Fig.16 A flowchart of memory pre-allocation and memory reallocation according to an example embodiment of the present disclosure is shown.

[0041] Fig.17 A flow chart illustrating group-based data exchange according to an example embodiment of the present disclosure is shown.

[0042] Fig.18 A block diagram of a memory management device according to an example embodiment of the present disclosure is shown.

[0043] Fig.19 yes Figure 1 A block diagram of example components of one or more devices. DETAILED DESCRIPTION

[0044] The following specific embodiments are provided to help the reader gain a comprehensive understanding of the methods, devices and / or systems described herein. However, after understanding the disclosure of the present disclosure, various changes, modifications and equivalents of the methods, devices and / or systems described herein will be clear. For example, the order of operations described herein is only an example and is not limited to those orders set forth herein, but can be changed as will be clear after understanding the disclosure of the present disclosure, except for operations that must occur in a specific order. In addition, for increased clarity and conciseness, the description of features known after understanding the disclosure of the present disclosure may be omitted.

[0045] The features described herein can be implemented in different forms and should not be construed as being limited to the examples described herein. Rather, the examples described herein have been provided to illustrate only some of the many possible ways to implement the methods, devices, and / or systems described herein that will be apparent after understanding the disclosure of the present disclosure.

[0046] Throughout the specification, when a component is described as being "connected to" or "coupled to" another component, the component may be directly "connected to" or "coupled to" the other component, or there may be one or more other components between them. Conversely, when an element is described as being "directly connected to" or "directly coupled to" another element, there may be no other elements between them. Similarly, similar expressions (e.g., "between" versus "immediately between" and "adjacent to" versus "immediately adjacent to") should also be interpreted in the same manner. As used herein, the term "and / or" includes any one of the relevant listed items or any combination of any two or more of the relevant listed items.

[0047] Although terms such as "first", "second" and "third" may be used to describe various components, components, regions, layers or parts herein, these components, components, regions, layers or parts are not limited by these terms. Instead, these terms are only used to distinguish one component, component, region, layer or part from another component, component, region, layer or part. Therefore, without departing from the teachings of the examples described herein, the first component, first component, first region, first layer or first part referred to in the examples may also be referred to as the second component, second component, second region, second layer or second part.

[0048] The terms used herein are only used to describe various examples and will not be used to limit the disclosure. Unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. The terms "comprise", "include" and "have" indicate the presence of the stated features, quantities, operations, components, elements and / or combinations thereof, but do not exclude the presence or addition of one or more other features, quantities, operations, components, elements and / or combinations thereof.

[0049] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art based on the understanding of the disclosure of the present disclosure and the present disclosure. Unless explicitly defined as such herein, terms (such as those defined in general dictionaries) should be interpreted as having a meaning consistent with their meaning in the context of the relevant field and the disclosure of the present disclosure, and should not be interpreted in an idealized or overly formal way. The use of the term "may" with respect to an example or embodiment herein (e.g., with respect to what an example or embodiment may include or implement) indicates that there is at least one example or embodiment that includes or implements such a feature, and all examples are not limited thereto.

[0050] Figure 1 A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0051] Reference Figure 1 In operation S110, the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated can be predicted based on the unused memory (UM) value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated, wherein the delay sensitivity of the virtual machine indicates whether the virtual machine is sensitive to delay.

[0052] Since the unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated is used as a basis for predicting the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated, the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated can be accurately predicted.

[0053] The unused memory value of the second virtual machine to which memory is to be allocated may be a ratio of memory that is not accessed by the new virtual machine when memory is pre-allocated (e.g., the unused memory value may be a percentage value). In one or more examples, for a reference virtual machine (e.g., at least one first virtual machine), the unused memory value of the reference virtual machine may be obtained by scanning the access bits of the hypervisor page table during the life cycle of the reference virtual machine. However, the manner of obtaining the unused memory value of the reference virtual machine is not limited thereto, and the unused memory value of the reference virtual machine may be obtained by any existing method. Data obtained from a reference virtual machine and used for prediction of another virtual machine may be referred to as reference data or historical data.

[0054] Delay sensitivity may be indicated by a sensitivity label of a virtual machine. The sensitivity label of a reference virtual machine may be manually or automatically marked as delay sensitive or insensitive. For example, the sensitivity label of a reference virtual machine may be marked as delay sensitive or insensitive according to one or more of the following conditions: workload performance of the reference virtual machine throughout its life cycle, operational experience, and offline experimental results, or any other suitable condition indicating delay sensitivity. For example, the sensitivity label of a virtual machine may be marked as a first value or a second value, wherein the first value indicates that the virtual machine is sensitive to delay (e.g., memory delay), and the second value indicates that the virtual machine is insensitive to delay. In one or more examples, delay sensitivity may be based on the workload performance of the virtual machine. For example, if the workload increases by a predetermined amount, and the delay of the virtual machine (e.g., the amount of time required to process one or more tasks) increases by a percentage greater than a predetermined percentage (e.g., 5%-10%), the virtual machine may be determined to be delay sensitive. However, if the workload increases by a predetermined amount, and the delay of the virtual machine does not increase or increases by a percentage less than or equal to a predetermined percentage, the virtual machine may be determined to be not delay sensitive (e.g., delay insensitive). Workload performance is an example of a latency condition, where when the latency condition is met, a virtual machine can be determined to be latency sensitive.

[0055] In one or more embodiments, at least one first virtual machine is one of the n virtual machines that are most similar to the second virtual machine in memory usage information among the multiple first virtual machines to which memory has been allocated, where n is a positive integer. For example, the memory usage information of the virtual machine may include the identity of the customer corresponding to the virtual machine, the type of application corresponding to the virtual machine, the location of the customer (e.g., city and region, etc.), information of the processor required or specified by the virtual machine (e.g., central processing unit (CPU), graphics processing unit (GPU), neural processing unit (NPU), etc.), information of the memory required or specified by the virtual machine (e.g., size, type, etc. of the memory), or one or more of any other memory usage information known to those skilled in the art. In one or more embodiments, since the unused memory value and / or delay sensitivity of the second virtual machine to be allocated memory can be predicted based on the unused memory value and / or delay sensitivity of the n virtual machines that are most similar to the second virtual machine in memory usage information, the unused memory value and / or delay sensitivity of the second virtual machine to be allocated memory can be predicted more accurately. In one or more examples, when one or more pieces of memory usage information of the first virtual machine match one or more pieces of memory usage information of the second virtual machine, the first virtual machine is similar to the second virtual machine.

[0056] Will be combined later Figure 2 Operation S110 is described in more detail in FIG.

[0057] In operation S120 , the memory to be allocated of the second virtual machine may be pre-allocated based on the predicted unused memory value and / or delay sensitivity of the second virtual machine.

[0058] As discussed above, since the unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated is used as the basis for predicting the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated, the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated can be accurately predicted. Therefore, compared with the prior art in which the entire memory address space corresponding to the maximum memory amount of the virtual machine must be statically pre-allocated, it is more reasonable to pre-allocate the memory of the second virtual machine based on the accurately predicted unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated, which reduces the possibility of memory idleness.

[0059] The following will be combined Figure 3 to Figure 4 The method of pre-allocating the memory to be allocated of the second virtual machine is described in more detail.

[0060] Figure 2 A flowchart showing a method for predicting an unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated according to an exemplary embodiment of the present disclosure is shown.

[0061] Reference Figure 2 In operation S210, at least one similarity between memory usage information of at least one first virtual machine and memory usage information of a second virtual machine may be determined.

[0062] The memory usage information of the virtual machine may include one or more of the identity of the customer corresponding to the virtual machine, the type of application corresponding to the virtual machine, the location of the customer, information about the processor required or specified for the virtual machine, and information about the memory required or specified for the virtual machine.

[0063] In one or more examples, the similarity between two virtual machines may be the inverse of the Euclidean distance between the two virtual machines. However, the measure of similarity between two virtual machines is not limited to this method and may be determined using any other similarity representation. In the example of using Euclidean distance to determine similarity, since the memory usage information of the virtual machine may have string-type features (e.g., customer ID and application type), the calculation of the Euclidean distance may be slightly modified. For string-type features, the feature difference may be defined as: 0 (string attribute values ​​are exactly the same), 1 (string attribute values ​​are not the same). For example, memory usage information may include attribute 1 (e.g., customer ID), attribute 2 (e.g., application type), and attribute 3 (processor information). If attribute 1 and attribute 2 match between two virtual machines, but attribute 3 does not match, the string value may be 001. The string value may be converted into a coordinate or a reference number, where the Euclidean distance may be determined between the coordinate or reference number and a reference point (e.g., coordinate (0,0) on a 2D graph). In one or more examples, the Euclidean distance may be determined as

[0064] Will be combined later Figure 3 Operation S210 is described in more detail.

[0065] In operation S220, an unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated may be predicted based on at least one similarity and an unused memory value and / or delay sensitivity of at least one first virtual machine.

[0066] Even with a small amount of reference virtual machine data, good results can be obtained by predicting the unused memory value and / or delay sensitivity of the second virtual machine to be allocated memory based on similarity. In addition, compared with traditional machine learning methods, the performance of the method for predicting the unused memory value and / or delay sensitivity of the second virtual machine to be allocated memory based on similarity is less affected by changes in data distribution.

[0067] In one or more embodiments, the one or more first virtual machines include n first virtual machines, where n is a positive integer. In one or more examples, n weights may be assigned to the n unused memory values ​​of the n virtual machines based on n similarities between the n pieces of memory usage information of the n first virtual machines and the memory usage information of the second virtual machine.

[0068] Similarity can be calculated and / or defined in various ways and weights can be assigned based on the similarity. In one or more examples, when the similarity between the memory usage information of the first virtual machine and the memory usage information of the second virtual machine indicates that the first virtual machine and the second virtual machine have the same specific memory usage information (for example, as an example only, one or more of the customer ID, the application type corresponding to the virtual machine, the customer's location, the information of the processor required or specified by the virtual machine, and the information of the memory required or specified by the virtual machine), a first weight is assigned to the unused memory value of the first virtual machine; when the similarity between the memory usage information indicates that the first virtual machine and the second virtual machine do not have the same specific memory usage information, a second weight is assigned to the unused memory value of the first virtual machine, wherein the first weight is greater than the second weight. In another example, when the similarity between the memory usage information of the first virtual machine and the memory usage information of the second virtual machine is calculated by a similarity representation method (e.g., a similarity representation method based on Euclidean distance), if the similarity between the memory usage information of the first virtual machine and the memory usage information of the second virtual machine indicates a first similarity, a first weight may be assigned to the unused memory value of the first virtual machine; if the similarity between the memory usage information of the first virtual machine and the memory usage information of the second virtual machine indicates a second similarity less than the first similarity, a second weight may be assigned to the unused memory value of the first virtual machine, wherein the first weight is greater than the second weight. In this other example, since the first virtual machine having a large similarity is assigned a relatively large weight, the unused memory value of the second virtual machine can be predicted more accurately. However, the above example is exemplary, and weights may be assigned based on the similarity between memory usage information in various other methods.

[0069] The estimated unused memory value of the second virtual machine may be predicted by performing a weighted average calculation based on the n unused memory values ​​of the n first virtual machines and n weights corresponding to the n unused memory values.

[0070] For example, when n=2, the one or more first virtual machines include two first virtual machines (e.g., a first reference virtual machine and a second reference virtual machine). A weight (e.g., a first weight) may be assigned to a first unused memory value of the first reference virtual machine based on a comparison result between memory usage information of the second virtual machine and memory usage information of the first reference virtual machine. A weight (e.g., a second weight) may be assigned to a second unused memory value of the second reference virtual machine based on a comparison result between memory usage information of the second virtual machine and memory usage information of the second reference virtual machine. The first weight and the second weight may be the same or different. An estimated unused memory value of the second virtual machine may be predicted by performing a weighted average calculation based on the first unused memory value, the first weight, the second unused memory value, and the second weight. For example, estimated unused memory value=(first unused memory value×first weight+second unused memory value×second weight) / (first weight+second weight).

[0071] However, the number of the one or more first virtual machines is not limited thereto, and the one or more first virtual machines may include three or more reference virtual machines. The method for calculating the estimated unused memory value of the second virtual machine in the case where the one or more first virtual machines may include three or more reference virtual machines may be similar to the method for calculating the estimated unused memory value of the second virtual machine in the case where the one or more first virtual machines include the first reference virtual machine and the second reference virtual machine. For example, in the case where the one or more first virtual machines may include three reference virtual machines (e.g., the first reference virtual machine, the second reference virtual machine, and the third reference virtual machine), the estimated unused memory value = (first unused memory value × first weight + second unused memory value × second weight + third unused memory value × third weight) / (first weight + second weight + third weight).

[0072] Figure 3 A flowchart showing a method for predicting delay sensitivity of a second virtual machine to which memory is to be allocated according to an exemplary embodiment of the present disclosure is shown.

[0073] Reference Figure 3 In operation S310, in response to the similarity indicating that memory usage information of the second virtual machine is the same as memory usage information of one or more first virtual machines in the at least one first virtual machine, it can be determined whether the one or more first virtual machines are sensitive to delay.

[0074] For example, when the reference virtual machine and the new virtual machine have the same memory usage information, it may be determined whether the one or more first virtual machines are sensitive to latency.

[0075] In operation S320, in response to the number of delay-sensitive first virtual machines among the one or more first virtual machines being greater than or equal to half of the number of the one or more first virtual machines, the delay sensitivity of the second virtual machine may be predicted to be sensitive. For example, when there are five first virtual machines, if three of the five first virtual machines are delay-sensitive, the second virtual machine may be determined to be delay-sensitive.

[0076] When there is only one reference virtual machine that is identical to the second virtual machine in memory usage information, and the delay sensitivity of the one reference virtual machine is sensitive, the delay sensitivity of the second virtual machine is predicted to be sensitive. When there are multiple reference virtual machines that are identical to the second virtual machine in memory usage information, and the delay sensitivity of most of the multiple reference virtual machines is sensitive, the delay sensitivity of the second virtual machine is predicted to be sensitive.

[0077] In operation S330 , in response to the number of delay-sensitive first virtual machines among the one or more first virtual machines being less than half of the number of the one or more first virtual machines, the delay sensitivity of the second virtual machine is predicted to be insensitive.

[0078] When there is only one reference virtual machine that is identical to the second virtual machine in memory usage information, and the delay sensitivity of the one reference virtual machine is insensitive, the delay sensitivity of the second virtual machine is predicted to be insensitive. When there are multiple reference virtual machines that are identical to the second virtual machine in memory usage information, and the delay sensitivity of most of the multiple reference virtual machines is insensitive, the delay sensitivity of the second virtual machine is predicted to be insensitive.

[0079] According to the method for predicting the delay sensitivity of the second virtual machine to which memory is to be allocated according to the example embodiment, the delay sensitivity of the second virtual machine can be accurately predicted based on the delay sensitivity of one or more first virtual machines having the same memory usage information as the second virtual machine.

[0080] Figure 4 A flowchart showing a method of pre-allocating memory to be allocated of a second virtual machine according to an exemplary embodiment of the present disclosure.

[0081] Reference Figure 4 In operation S410, in response to only the delay sensitivity of the unused memory value and the delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is sensitive to delay, the memory to be allocated of the second virtual machine may be pre-allocated into the local memory.

[0082] As those skilled in the art understand, local memory may have lower latency. Therefore, by pre-allocating latency-sensitive memory to local memory, the latency of the memory of the second virtual machine may be minimized.

[0083] Operation S410 may correspond to one or more embodiments of predicting only the delay sensitivity of the second virtual machine to which memory is to be allocated.

[0084] In operation S420, in response to only the unused memory value in the unused memory value and the delay sensitivity being predicted, memory in the memory to be allocated of the second virtual machine corresponding to the predicted unused memory value of the second virtual machine may be preallocated to the pool memory, and the remaining memory in the memory to be allocated of the second virtual machine except the predicted unused memory may be preallocated to the local memory.

[0085] Compared to local memory, pool memory may have a larger storage capacity and a relatively high latency. Therefore, by pre-allocating the memory corresponding to the predicted unused memory value of the second virtual machine in the memory to be allocated of the second virtual machine to the pool memory, the storage space of the local memory can be saved, and the idle problem of the local memory can be reduced. In one or more examples, memory idleness refers to a situation where the memory allocated to the virtual machine is not used.

[0086] Operation S420 may correspond to one or more embodiments of predicting only the unused memory value of the second virtual machine to which memory is to be allocated.

[0087] In one or more examples, the local memory and the pool memory can be local memory and pool memory in a Compute Express Link (CXL)-Memory Extender (MXP) based memory pool system, where the customer's workload is deployed in the form of virtual machines. Compute Express Link is an interconnect standard that supports cacheable load / store access to pool memory with nanosecond latency. Compute Express Link memory (e.g., pool memory) is virtualized using a hypervisor page table and a memory management unit, so it can be accessed like local memory (e.g., local DRAM, as an example only). In one or more embodiments, Compute Express Link can provide a shared memory pool for virtual machines as secondary memory, and the pool memory in the shared memory pool can be dynamically reallocated to different hosts.

[0088] However, the above examples are merely exemplary, and the local memory and pool memory may also be any other local memory and pool memory, wherein the local memory has lower latency, and compared to the local memory, the pool memory generally has a larger storage capacity and relatively higher latency.

[0089] In operation S430, in response to both the unused memory value and the delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is not sensitive to delay, the predicted unused memory in the memory to be allocated of the second virtual machine may be preallocated to the pool memory, and the remaining memory in the memory to be allocated of the second virtual machine except the predicted unused memory may be preallocated to the local memory.

[0090] Operation S430 may correspond to an embodiment of predicting an unused memory value and a delay sensitivity of a second virtual machine to which memory is to be allocated.

[0091] The examples or embodiments described above may be combined in various ways. For example, one or more of operation S410, operation S420, and operation S430 may be performed.

[0092] Figure 5 A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0093] Reference Figure 5 In operation S510, it is determined whether the unused memory in the allocated memory of the second virtual machine is overestimated by comparing the actual unused memory of the second virtual machine monitored when the second virtual machine is running with the unused memory in the allocated memory of the second virtual machine.

[0094] For example, whether the unused memory in the allocated memory of the second virtual machine is overestimated can be monitored throughout the runtime of the second virtual machine. If the unused memory is overestimated during the memory pre-allocation process, the second virtual machine must store part of its data on the pool memory. Since the access latency of the pool memory may have different effects on different virtual machines, the latency of the virtual machine can be further considered to perform the memory allocation operation to meet the virtual machine's requirements for latency or conditions. In one or more examples, the unused memory is overestimated when the unused memory is a predetermined amount (e.g., 100Mb) or percentage (e.g., 5%) above the predicted amount of unused memory.

[0095] In one or more examples, in response to the monitored actual unused memory of the second virtual machine being significantly less than the unused memory in the allocated memory of the second virtual machine, the unused memory in the allocated memory of the second virtual machine can be determined to be overestimated. Here, significantly less than can be set according to design needs. For example, significantly less than can indicate that the monitored actual unused memory of the second virtual machine is less than the unused memory in the allocated memory of the second virtual machine by at least a predetermined value or a predetermined ratio.

[0096] In operation S520 , in response to determining that the unused memory in the allocated memory of the second virtual machine is overestimated, it is estimated whether the second virtual machine is sensitive to delay.

[0097] The following will refer to Figure 6 A method for estimating whether a second virtual machine is sensitive to delay is described below.

[0098] In operation S530 , in response to the second virtual machine being estimated to be sensitive to latency, unused memory of the second virtual machine is reallocated to the local memory.

[0099] Since local memory has lower latency, pool memory generally has larger storage capacity and relatively higher latency than local memory. Therefore, when the unused memory of the second virtual machine is determined to be overestimated during operation and the second virtual machine is sensitive to latency, the latency of the memory of the second virtual machine can be reduced by reallocating the unused memory of the second virtual machine to the local memory, thereby meeting the customer's requirements or conditions for the latency of the virtual machine.

[0100] Figure 6 A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0101] Reference Figure 6 In operation S610, a core performance measurement unit (PMU) indicator of at least one first virtual machine and a core performance measurement unit indicator of a second virtual machine may be obtained.

[0102] In one or more examples, the core performance measurement unit indicator of the virtual machine may include at least one of the latency required or specified by the virtual machine, the bandwidth required or specified by the virtual machine, memory limitation information about the virtual machine, and core limitation information about the virtual machine. However, the above examples are exemplary, and the core performance measurement unit indicator of the virtual machine is not limited thereto.

[0103] In operation S620, N virtual machines in at least one first virtual machine that are most similar to the second virtual machine in terms of delay-related information may be determined by comparing the core performance measurement unit indicator of the at least one first virtual machine with the core performance measurement unit indicator of the second virtual machine, where N is a positive integer.

[0104] In one or more examples, a similarity measurement method based on Euclidean distance may be used to determine N virtual machines in at least one first virtual machine that are most similar to the second virtual machine in terms of delay-related information. However, the above examples are exemplary, and the similarity measurement method indicator is not limited to the similarity measurement method based on Euclidean distance, and may be any other similarity measurement method.

[0105] In operation S630 , it may be determined whether the second virtual machine is sensitive to delay based on a ratio of virtual machines having a delay-sensitive tag among the N virtual machines.

[0106] In one or more examples, weighted voting may be performed on the sensitivity labels of the N most similar virtual machines. When the majority of votes for the N most similar virtual machines in terms of reference are delay sensitive, the second virtual machine is determined to be delay sensitive. When the majority of votes for the N most similar virtual machines in terms of reference are delay insensitive, the second virtual machine is determined to be delay insensitive.

[0107] Figure 7A flowchart of a memory management method according to an exemplary embodiment of the present disclosure is shown.

[0108] Reference Figure 7 In operation S710, in response to the second virtual machine being estimated to be insensitive to delay, data stored in the local memory of the second virtual machine may be clustered into a plurality of groups according to program contexts and access times of application programs on the second virtual machine.

[0109] Data with similar access counts and program contexts tend to have similar access patterns. In one or more examples, the access count may reflect past access frequencies. For example, the access count may refer to the number of memory accesses within a predetermined time interval. The program context represents a program phase, and the same phase is likely to be executed repeatedly. Therefore, it can be used to estimate the program's future data access patterns.

[0110] In one or more examples, the data may be represented by a two-dimensional vector formed by program context and access counts. The data is then clustered into multiple groups using statistical methods or clustering methods such as K-means.

[0111] Program context is the sum of program counter values ​​along the execution path that writes related function calls. Program context is calculated by scanning the stack to find the return address of each function call; aggregating these return addresses.

[0112] In operation S720 , one or more groups having the least average number of accesses among the plurality of groups may be stored in the pool memory and / or one or more groups having the greatest average number of accesses among the plurality of groups may be stored in the local memory.

[0113] Figure 7 The memory management method according to the example embodiment of the present disclosure shown may also be referred to herein as a group-based data exchange strategy. In the group-based data exchange strategy, data with similar access patterns are aggregated into the same group, and data groups with fewer accesses are moved to the pool memory, thereby reducing the access frequency of the pool memory. In one or more examples, in the group-based data exchange strategy, data with similar access patterns are aggregated into the same group, and data groups with more accesses are moved to the local memory, thereby reducing the latency of accessing the memory.

[0114] Figure 8 A schematic diagram showing a virtual machine server according to an example embodiment of the present disclosure.

[0115] Reference Figure 8, a virtual machine server may include multiple hosts (host #1 to host #n) and a memory pool (e.g., a CXL memory pool). Each of the multiple hosts may include an application and local memory (e.g., local DRAM), and communicate with the memory pool through a communication protocol (e.g., CXL.mem, as an example only). An application may create a virtual machine (VM). In one or more examples, through an application on host #1, a virtual machine of an application on host #1 may be allocated a predetermined range of virtual address space. According to an example embodiment of the present disclosure, a portion of the allocated virtual address space may be allocated to correspond to local memory, and another portion of the allocated virtual address space may be allocated (e.g., deaggregated) to correspond to corresponding pool memory in a memory pool.

[0116] In the virtual machine server according to the exemplary embodiment of the present disclosure, since CXL can provide a shared memory pool as secondary memory for the VM, the shared memory pool can be dynamically reallocated to different hosts, so that multiple hosts share the pool memory, breaking the fixed hardware configuration of the host and reducing memory idleness. In addition, in the virtual machine server according to the exemplary embodiment of the present disclosure, since the pool memory (e.g., DRAM) is rarely accessed or even not accessed, the DRAM configured for each server can be reduced and the unused memory (UM) can be decomposed into the shared memory pool with little performance loss.

[0117] Fig. 9 A schematic diagram showing a memory management method according to an example embodiment of the present disclosure.

[0118] Reference Fig. 9 , a memory management method according to an example embodiment of the present disclosure may include memory pre-allocation, memory reallocation, and group-based data exchange.

[0119] Memory pre-allocation may mainly include unused memory (UM) estimation and sensitivity check (eg, latency sensitivity check) of the new virtual machine (eg, the second virtual machine).

[0120] When a virtual machine (VM) request is received, if there is no reference virtual machine (e.g., the first virtual machine) identical to the new virtual machine, an unused memory estimation of the new virtual machine may be performed. After performing the unused memory estimation of the new virtual machine, the estimated unused memory of the new virtual machine may be pre-allocated into the pool memory.

[0121] When a virtual machine request is received, if there is a reference virtual machine that is the same as the new virtual machine, a sensitivity check of the new virtual machine may be performed. When the sensitivity check of the new virtual machine indicates that the new virtual machine is not sensitive to latency, an unused memory estimation of the new virtual machine may be further performed. When the sensitivity check of the new virtual machine indicates that the new virtual machine is sensitive to latency, all of the memory of the new virtual machine may be pre-allocated to local memory. In one or more examples, assume that the memory of the new virtual machine includes frequently used memory, infrequently used memory, and unused memory. Frequently used memory may be space for storing hot data, infrequently used memory may be space for storing cold data, and unused memory may be space that has never been accessed. In one or more examples, hot data may refer to data that has been accessed more than a threshold number of times within a period of time, and cold data may refer to data that has been accessed equal to or less than a threshold number of times within a period of time. However, the present disclosure is not limited thereto, and the memory of the new virtual machine may also include only one or more of frequently used memory, infrequently used memory, and unused memory. For example, referring to Fig. 9 When the sensitivity check of the virtual machine VM1 indicates that the virtual machine VM1 is sensitive to delay, the frequently used memory, the infrequently used memory and the unused memory in the memory of the virtual machine VM1 may be allocated to the local memory. VM1 may be initially sensitive to delay.

[0122] In one or more examples, memory reallocation can include unused memory monitoring and sensitivity estimation. Unused memory monitoring can be used to monitor whether unused memory is overestimated throughout the runtime of the virtual machine. Sensitivity estimation is used to predict whether the performance of the application will degrade as memory latency increases and determine whether to fully reallocate the virtual machine's memory to local memory.

[0123] When unused memory monitoring indicates that unused memory is not overestimated, you can continue to perform unused memory monitoring. Fig. 9 , when the virtual machine VM2 is determined to be insensitive to latency in memory pre-allocation and the unused memory of the virtual machine VM2 is determined to be not overestimated in memory reallocation, the frequently used memory and the infrequently used memory of the virtual machine VM2 can be allocated to the local memory, and the unused memory of the virtual machine VM2 can be allocated to the pool memory. In the case where the unused memory is not overestimated, VM2 can be latency insensitive.

[0124] When unused memory monitoring indicates that unused memory is overestimated, sensitivity estimation can be performed. For example, a similarity-based approach can be used to identify latency-sensitive virtual machines. When the sensitivity estimation indicates that a new virtual machine is latency-sensitive, all of the memory of the new virtual machine can be reallocated to local memory to avoid performance degradation. For example, referring to Fig. 9When the sensitivity estimate of the virtual machine VM3 indicates that the virtual machine VM3 is sensitive to delay at runtime (eg, runtime sensitive), the frequently used memory, the infrequently used memory, and the unused memory of the virtual machine VM3 may be allocated to the local memory.

[0125] When the sensitivity estimate indicates that the new virtual machine is not sensitive to latency, group-based data swapping can be performed. In group-based data swapping, cold data of the latency-insensitive virtual machines is swapped into the pool memory, thereby reducing the access frequency of the pool memory. For example, referring to Fig. 9 , when the unused memory of virtual machine VM4 is determined to be not overestimated in memory reallocation and the sensitivity estimate of virtual machine VM4 indicates that virtual machine VM4 is not sensitive to latency at runtime, the frequently used memory of virtual machine VM4 can be allocated to local memory, and the infrequently used memory and unused memory of virtual machine VM4 can be allocated to pool memory. In the case of overestimated unused memory, VM4 can be latency insensitive.

[0126] Fig.10 A schematic diagram showing memory pre-allocation according to an example embodiment of the present disclosure.

[0127] Reference Fig.10 Memory resources may be pre-allocated for the virtual machine based on an initial sensitivity check result and an estimated unused memory value UM (eg, a percentage value).

[0128] In response to the request from the new VM, a same VM search may be performed. The same VM search may be performed by comparing the memory usage information of the new virtual machine (e.g., for example only, the same customer ID, application type, and location (the customer's location, such as city and region)) with the memory usage information of the reference VM and returning search results.

[0129] If the search results indicate that there is an identical reference virtual machine with identical memory usage information as the new virtual machine, it may be determined whether the new virtual machine is latency sensitive. When the search results indicate that there is an identical reference virtual machine with identical memory usage information as the new virtual machine and the identical reference virtual machine is latency sensitive, the memory (e.g., frequently used memory, infrequently used memory, and unused memory) of the new virtual machine may be fully allocated to the local memory. Fig.10 , the frequently used memory, infrequently used memory, and unused memory of the new virtual machine VM1 can be completely allocated to the local memory.

[0130] If the search result indicates that there is no reference virtual machine with the same memory usage information as the new virtual machine, UM estimation can be performed to estimate the UM of the new virtual machine. After estimating the UM of the new virtual machine, memory corresponding to the UM in the memory of the new virtual machine can be allocated to the pool memory, and memory corresponding to 100%-UM in the memory of the new virtual machine can be allocated to the local memory. Fig.10 , the memory corresponding to UM (e.g., unused memory) in the memory of the new virtual machine VM2 can be allocated to the pool memory, and the memory corresponding to 100%-UM (e.g., frequently used memory and infrequently used memory) in the memory of the new virtual machine can be allocated to the local memory.

[0131] Fig.11 A schematic diagram showing a similarity-based unused memory estimation method according to an example embodiment of the present disclosure is shown.

[0132] In one or more examples, the UM can be used to reflect the proportion of memory that the new virtual machine will not access when the pool memory is pre-allocated. By performing similarity measurement using a similarity-based estimation method, the n most similar VMs to the new VM can be found from the historical records, and the estimated UM of the new VM is a weighted average of the UM values ​​of the n most similar VMs. In one or more examples, by finding the n most similar virtual machines on the reference, each similar virtual machine can be assigned a different weight (e.g., weights W1 to Wn) according to its customer ID, which can be used to more accurately estimate the UM or sensitivity of the virtual machine. If the similar VM has the same customer ID as the new VM, its weight is a first weight (e.g., 2), otherwise its weight is a second weight (e.g., 1) that is smaller than the first weight.

[0133] In one or more examples, for a historical virtual machine, its UM value can be obtained by scanning the access bits of the hypervisor page table during its life cycle. Fig.11 As shown, the similarity of two VMs can be the inverse of the Euclidean distance of the two VMs. Due to the presence of string-type features (such as customer ID and application type), the calculation of the Euclidean distance can be slightly modified. For string-type features, feature differences are defined as: 0 (the string attribute values ​​are exactly the same) and 1 (the string attribute values ​​are different).

[0134] Even with a small amount of historical VM data, the similarity-based unused memory estimation method of the exemplary embodiment of the present disclosure can obtain good results. In addition, compared with traditional machine learning methods, the performance of the similarity-based unused memory estimation method of the exemplary embodiment of the present disclosure is less affected by changes in data distribution.

[0135] Fig.12A schematic diagram illustrating memory reallocation and group-based data exchange according to an example embodiment of the present disclosure.

[0136] Throughout the runtime of the virtual machine, the UM monitor monitors whether the UM is overestimated. In one or more examples, the UM monitor monitors whether the UM is overestimated by reading relevant information (e.g., access bits) from the page table. If the UM is overestimated during memory preallocation, the VM must store part of its data on the pool DRAM. Since the access latency of the pool DRAM may have different effects on different VMs, such as Fig.12 As shown, different strategies can be implemented. For example, when UM is overestimated during memory pre-allocation, a sensitivity estimation of the virtual machine can be performed.

[0137] When the sensitivity estimate of the virtual machine indicates that the virtual machine is sensitive to latency, the memory of the virtual machine (eg, frequently used memory, infrequently used memory, and unused memory) can be fully allocated to the local memory. Fig.12 , the frequently used memory, infrequently used memory, and unused memory of the new virtual machine VM3 can be completely allocated to the local memory.

[0138] When the sensitivity estimate of the virtual machine indicates that the virtual machine is not sensitive to delay, group-based data exchange can be performed. Fig.12 When the sensitivity estimation of the virtual machine VM4 indicates that the virtual machine VM4 is not sensitive to delay, the group-based data exchange can be performed. After performing the group-based data exchange, the frequently used memory of the virtual machine VM4 can be allocated to the local memory, and the infrequently used memory and unused memory of the virtual machine VM4 can be allocated to the pool memory.

[0139] According to the example embodiment of the present disclosure, memory reallocation can use a similarity-based sensitivity estimation method to identify latency-sensitive virtual machines, and completely reallocate the memory of the latency-sensitive virtual machines to local memory. Therefore, for latency-sensitive virtual machines, all of their memory will be reallocated to local DRAM to avoid the impact of pool access latency on application performance.

[0140] For latency-insensitive VMs, a group-based data exchange strategy can be implemented to exchange cold data into the pool memory. Therefore, for latency-insensitive VMs, a group-based data exchange strategy is proposed to reduce performance degradation, so no memory reallocation is required.

[0141] Fig.13 A schematic diagram illustrating estimating the sensitivity of a virtual machine according to an example embodiment of the present disclosure.

[0142] In one or more examples, the sensitivity estimate can be used to predict whether the performance of an application will degrade as memory latency increases and determine whether to fully reallocate the VM's memory to local DRAM. The sensitivity of a virtual machine can be estimated by the following two operations:

[0143] 1) Based on the core performance measurement unit (PMU) metric, a similarity measurement method based on Euclidean distance is used to find the N most similar VMs from the reference data.

[0144] 2) Perform weighted voting on the sensitivity labels of the N most similar virtual machines. In one or more examples, weighted voting can be performed by assigning weights (e.g., weights W1 to Wn) to the N most similar virtual machines. In the example of assigning the same weight to the N most similar virtual machines, the following is estimated to be sensitive: For the N most similar virtual machines in history, most votes are delay sensitive. The following is estimated to be insensitive: For the N most similar virtual machines in history, most votes are insensitive to delay.

[0145] Fig.14 A schematic diagram illustrating group-based data exchange according to an example embodiment of the present disclosure.

[0146] For VMs with latency-insensitive workloads, pool memory is used as secondary memory when its UM is overestimated. When local memory has almost no free capacity, infrequently accessed data is moved out to secondary memory (pool memory). As a result, latency-insensitive VMs access pool memory less frequently.

[0147] For some applications running on a virtual machine, there are multiple data access patterns. According to the analysis, data units (such as pages or address segments) with similar program contexts and access times are considered to have similar access patterns. Its main operations are as follows: cluster the data into several groups based on program contexts and access times. The group with the least average access times (for example, Fig.14 The group with an average access count of 4.5 shown in ) is moved out to the pool memory.

[0148] As those skilled in the art understand, data with similar access counts and program contexts tend to have similar access patterns. The access count can reflect the frequency of past accesses. The program context represents a program phase, and the same phase is likely to be executed repeatedly. Therefore, it can be used to estimate the program's future data access patterns.

[0149] Fig.15 A schematic diagram illustrating clustering data into groups according to an example embodiment of the present disclosure.

[0150] Reference Fig.15, the data can be represented by a two-dimensional vector formed by program context and access count. The data can be clustered into multiple groups using statistical methods or clustering methods such as K-means. In one or more examples, K-means can be implemented as an unsupervised learning algorithm, where clustering is performed between objects with similarities.

[0151] The program context is the sum of the program counter values ​​along the execution path that writes related function calls. This value is calculated by scanning the stack to find the return address of each function call; aggregating these return addresses.

[0152] Fig.16 A flowchart of memory pre-allocation and memory reallocation according to an example embodiment of the present disclosure is shown.

[0153] Reference Fig.16 , in memory pre-allocation, obtain the VM metadata of the new virtual machine (S1600). For the new virtual machine, first search the reference record for the same virtual machine with the same customer ID, application type and location (S1602). If the same VM exists (S1604), check whether the same VM is sensitive to latency (S1610). If it is sensitive to latency, allocate the VM's memory completely to the local DRAM (S1612). For the new VM, if there is no same VM in the reference record or the same VM is not sensitive to latency, use the proposed similarity-based method to predict the UM value (S1606). Allocate the UM portion of the VM memory to the DRAM pool (S1608).

[0154] In memory reallocation, a page table monitor is used to monitor the UM of all virtual machines (S1614). If the UM of a virtual machine is overestimated (S1616), the proposed similarity-based method is used to predict whether the workload of the virtual machine is latency sensitive (S1618). If the workload of the virtual machine is latency sensitive (S1620), its memory will be fully reallocated to the local DRAM (S1622). Otherwise, a group-based data exchange strategy is executed to ensure that cold data is stored on the pool memory (S1624).

[0155] Fig.17 A flow chart illustrating group-based data exchange according to an example embodiment of the present disclosure is shown.

[0156] Reference Fig.17, the local memory usage can be monitored by scanning the access bits of the page table through the local memory monitor (S1700). If the free space of the local memory is less than a specific threshold (S1702), the cold data is moved to the pool memory using the proposed group-based data exchange strategy (i.e., the data in the local memory is clustered into multiple groups according to the access count and program context (S1704). By calculating the average number of accesses for each group (S1706), the data group with the least average number of accesses is moved out to the pool DRAM). Otherwise, the local memory usage information is continuously monitored (S1708).

[0157] Fig.18 A block diagram of a memory management device according to an example embodiment of the present disclosure is shown.

[0158] Reference Fig.18 According to an example embodiment of the present disclosure, the memory management device 1800 may include a prediction module 1810 and a memory pre-allocation module 1820 .

[0159] The prediction module 1810 may predict the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated based on the unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated.

[0160] The memory pre-allocation module 1820 may pre-allocate the to-be-allocated memory of the second virtual machine based on the predicted unused memory value and / or delay sensitivity of the second virtual machine.

[0161] In other words, the prediction module 1810 performs a data prediction operation (eg, an operation of predicting or estimating unused memory values ​​and / or delay sensitivity), and the memory pre-allocation module 1820 performs a memory pre-allocation operation. Figures 1 to 17 One or more of the specific descriptions of data prediction operations and memory pre-allocation operations are described, so the same description will not be repeated here.

[0162] In addition, optionally, the memory management device 1800 may also include a memory reallocation module. The memory reallocation module may determine whether the unused memory in the allocated memory of the second virtual machine is overestimated by comparing the actual unused memory of the second virtual machine monitored when the second virtual machine is running with the unused memory in the allocated memory of the second virtual machine; in response to determining that the unused memory in the allocated memory of the second virtual machine is overestimated, estimate whether the second virtual machine is sensitive to latency; and in response to the second virtual machine being estimated to be sensitive to latency; reallocate the unused memory of the second virtual machine to the local memory. In other words, the memory reallocation module may perform a memory reallocation operation. As has been mentioned above with reference to Figures 1 to 17 One or more of the foregoing specifically describes the memory reallocation operation, and therefore, the same description will not be repeated here.

[0163] In addition, optionally, the memory management device 1800 may also include a data exchange module (not shown). The data exchange module may, in response to the second virtual machine being estimated to be insensitive to latency, cluster the data stored in the local memory of the second virtual machine into multiple groups according to the program context and access times of the application programs on the second virtual machine; store one or more groups with the least average access times among the multiple groups in the pool memory and / or store one or more groups with the most average access times among the multiple groups in the local memory. In other words, the memory reallocation module may perform group-based data exchange operations. As has been mentioned above with reference to Figures 1 to 17 One or more specific descriptions in the figure are based on the group data exchange operation, so the same description will not be repeated here.

[0164] Fig.19 yes Figure 1 1900 may correspond to user device 110 and / or platform 1160. Device 1900 may be any other suitable device, such as a television, a wall panel, etc. Fig.19 As shown in , the device 1900 may include a bus 1910 , a processor 1920 , a memory 1930 , a storage component 1940 , an input component 1950 , an output component 1960 , and a communication interface 1970 .

[0165] The bus 1910 includes components that allow communication between components of the device 1900. The processor 1920 is implemented in hardware, firmware, or a combination of hardware and software. The processor 1920 is a central processing unit (CPU), a graphics processing unit (GPU), an accelerated processing unit (APU), a microprocessor, a microcontroller, a digital signal processor (DSP), a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), or other types of processing components. In some embodiments, the processor 1920 includes one or more processors that can be programmed to perform functions. The memory 1930 includes a random access memory (RAM), a read-only memory (ROM), and / or another type of dynamic or static storage device (e.g., flash memory, magnetic memory, and / or optical memory) that stores information and / or instructions for use by the processor 1920.

[0166] Storage component 1940 stores information and / or software related to the operation and use of device 1900. For example, storage component 1940 may include a hard disk (e.g., a magnetic disk, an optical disk, a magneto-optical disk, and / or a solid-state disk), a compact disk (CD), a digital versatile disk (DVD), a floppy disk, a cassette, a magnetic tape, and / or another non-transitory computer-readable medium, and a corresponding drive.

[0167] Input components 1950 include components that allow device 1900 to receive information, such as through user input (e.g., a touch screen display, a keyboard, a keypad, a mouse, buttons, switches, and / or a microphone). In addition, or alternatively, input components 1950 may include sensors for sensing information (e.g., a global positioning system (GPS) component, an accelerometer, a gyroscope, and / or an actuator). Output components 1960 include components that provide output information from device 1900 (e.g., a display, a speaker, and / or one or more light emitting diodes (LEDs)).

[0168] The communication interface 1970 includes transceiver-like components (e.g., a transceiver and / or a separate receiver and transmitter) that enable the device 1900 to communicate with other devices, such as through a wired connection, a wireless connection, or a combination of wired and wireless connections. The communication interface 1970 can allow the device 1900 to receive information from another device and / or provide information to another device. For example, the communication interface 1970 may include an Ethernet interface, an optical interface, a coaxial interface, an infrared interface, a radio frequency (RF) interface, a universal serial bus (USB) interface, a Wi-Fi interface, a cellular network interface, etc.

[0169] Device 1900 may perform one or more of the processes described herein. Device 1900 may perform these processes in response to processor 1920 executing software instructions stored by non-transitory computer-readable media (such as memory 1930 and / or storage component 1940). Computer-readable media is defined herein as non-transitory memory. Storage devices include memory space within a single physical storage device or memory space distributed across multiple physical storage devices.

[0170] The software instructions may be read into the memory 1930 and / or storage component 1940 from another computer-readable medium or from another device through the communication interface 1970. When executed, the software instructions stored in the memory 1930 and / or storage component 1940 may cause the processor 1920 to perform one or more processes described herein. In addition, or alternatively, hard-wired circuitry may be used in place of or in combination with software instructions to perform one or more processes described herein. Therefore, the implementations described herein are not limited to any specific combination of hardware circuitry and software.

[0171] supply Fig.19 The number and arrangement of components shown are provided as examples. In practice, the apparatus 1900 may include more Fig.19 Additional components, fewer components, different components, or components in a different arrangement as shown. Additionally or alternatively, one set of components (e.g., one or more components) of device 1900 may perform one or more functions described as being performed by another set of components of device 1900.

[0172] According to the memory management method of the exemplary embodiment of the present disclosure, since the unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated is used as a basis for predicting the unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated, the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated can be accurately predicted.

[0173] According to the memory management method of the example embodiment of the present disclosure, since the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated can be predicted based on the unused memory values ​​and / or delay sensitivity of n virtual machines that are most similar to the second virtual machine in terms of memory usage information, the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated can be predicted more accurately.

[0174] According to the memory management method of the example embodiment of the present disclosure, compared with the prior art that must statically pre-allocate the entire memory address space corresponding to the maximum memory amount of the virtual machine, it is more reasonable to pre-allocate the memory of the second virtual machine based on the accurately predicted unused memory value and / or delay sensitivity of the second virtual machine to be allocated memory, which reduces the possibility of memory idleness.

[0175] According to the memory management method of the exemplary embodiment of the present disclosure, even with a small amount of reference virtual machine data, the unused memory value and / or delay sensitivity of the second virtual machine to be allocated memory based on similarity prediction can obtain good results. In addition, compared with traditional machine learning methods, the performance of the method for predicting the unused memory value and / or delay sensitivity of the second virtual machine to be allocated memory based on similarity is less affected by changes in data distribution.

[0176] According to the memory management method of the exemplary embodiment of the present disclosure, the delay sensitivity of the second virtual machine can be accurately predicted based on the delay sensitivity of one or more first virtual machines having the same memory usage information as the second virtual machine.

[0177] According to the memory management method of the exemplary embodiment of the present disclosure, by pre-allocating the memory to be allocated of the second virtual machine that is sensitive to latency into the local memory, the latency of the memory of the second virtual machine can be minimized.

[0178] According to the memory management method of the example embodiment of the present disclosure, by pre-allocating the memory corresponding to the predicted unused memory value of the second virtual machine in the to-be-allocated memory of the second virtual machine into the pool memory, the storage space of the local memory can be saved and the problem of idle local memory can be reduced.

[0179] According to the memory management method of the exemplary embodiment of the present disclosure, since the access delay of the pool memory may have different effects on different virtual machines, the delay of the virtual machine can be further considered to perform the memory allocation operation to meet the virtual machine's requirements or conditions for delay.

[0180] According to the memory management method of the example embodiment of the present disclosure, when the unused memory of the second virtual machine is determined to be overestimated during operation and the second virtual machine is sensitive to latency, the latency of the memory of the second virtual machine can be reduced by reallocating the unused memory of the second virtual machine to the local memory, thereby meeting the customer's requirements or conditions for the latency of the virtual machine.

[0181] According to the memory management method of the exemplary embodiment of the present disclosure, in the group-based data exchange strategy, data with similar access patterns are aggregated into the same group, and the data group with fewer access times is moved to the pool memory, thereby reducing the access frequency of the pool memory. Optionally, in the group-based data exchange strategy, data with similar access patterns are aggregated into the same group, and the data group with more access times is moved to the local memory, thereby reducing the latency of accessing the memory.

[0182] According to the memory management method of the example embodiment of the present disclosure, since pool memory (e.g., DRAM) is rarely or not accessed, the DRAM configured for each server can be reduced and unused memory (UM) can be decomposed into a shared memory pool with little performance loss.

[0183] According to the memory management method of the exemplary embodiment of the present disclosure, the similarity-based method is less affected by changes in data distribution, it performs well even if the number of reference virtual machines is small, and accurate results are obtained by assigning different weights to similar virtual machines according to customer IDs. Therefore, the used and unused memory of the VM can be more reasonably allocated by accurately estimating UM and delay sensitivity.

[0184] According to the memory management method of the example embodiment of the present disclosure, a group-based data exchange strategy is proposed to aggregate data with similar access patterns into the same group and move data groups with fewer access times to pool memory, thereby reducing the access frequency of the pool memory.

[0185] According to the memory management method of the exemplary embodiment of the present disclosure, a CXL memory pool that can be accessed with nanosecond latency is used to solve the memory stranding problem.

[0186] According to the memory management method of the exemplary embodiment of the present disclosure, through accurate memory allocation and management, pool memory access of delay-sensitive applications can be avoided and pool memory access of delay-insensitive applications can be reduced.

[0187] CXL memory is virtualized using a hypervisor page table and a memory management unit, and can therefore be statically pre-allocated to a virtual machine. Therefore, the memory management method according to an example embodiment of the present disclosure is compatible with a virtualized accelerator.

[0188] According to one or more example embodiments, the methods described above may be implemented using hardware, a combination of hardware and software, or a non-transitory storage medium storing executable software for performing its functions.

[0189] The hardware may be implemented using processing circuitry such as, but not limited to, one or more processors, one or more central processing units (CPUs), one or more controllers, one or more arithmetic logic units (ALUs), one or more digital signal processors (DSPs), one or more microcomputers, one or more field programmable gate arrays (FPGAs), one or more systems on a chip (SoCs), one or more programmable logic units (PLUs), one or more microprocessors, one or more application specific integrated circuits (ASICs), or any other device capable of responding to and executing instructions in a defined manner.

[0190] Software may include computer programs, program codes, instructions, or some combination thereof that are used to independently or collectively instruct or configure hardware devices to operate as desired. Computer programs and / or program codes may include programs or computer-readable instructions, software components, software modules, data files, data structures, etc. that can be implemented by one or more hardware devices (such as, one or more of the hardware devices mentioned above). Examples of program code include both machine code generated by a compiler and high-level program code executed using an interpreter.

[0191] For example, when the hardware device is a computer processing device (e.g., one or more processors, CPUs, controllers, ALUs, DSPs, microcomputers, microprocessors, etc.), the computer processing device may be configured to execute a program code that performs arithmetic, logic, and input / output operations according to the program code. Once the program code is loaded into the computer processing device, the computer processing device may be programmed to execute the program code, thereby converting the computer processing device into a special-purpose computer processing device. In a more specific example, when the program code is loaded into the processor, the processor becomes programmed to execute the program code and operations corresponding thereto, thereby converting the processor into a special-purpose processor. In another example, the hardware device may be an integrated circuit (e.g., ASIC) customized as a special-purpose processing circuit.

[0192] A hardware device (such as a computer processing device) can run an operating system (OS) and one or more software applications running on the OS. In response to the execution of the software, the computer processing device can also access, store, manipulate, process and create data. For the sake of simplicity, one or more example embodiments may be exemplified as a computer processing device, however, those skilled in the art will understand that the hardware device may include multiple processing elements and multiple types of processing elements. For example, the hardware device may include multiple processors or a processor and a controller. In addition, other processing configurations are feasible, such as parallel processors.

[0193] The software and / or data may be implemented permanently or temporarily in any type of storage medium (storage medium includes, but is not limited to, any machine, component, physical or virtual device or computer storage medium or device capable of providing instructions or data to a hardware device, or capable of providing instructions or data to be interpreted by a hardware device). The software may also be distributed on networked computer systems so that the software is stored and executed in a distributed manner. Specifically, for example, the software and data may be stored by one or more computer-readable recording media including tangible or non-transitory computer-readable storage media as discussed herein.

[0194] For example, according to an exemplary embodiment of the present invention, a computer-readable storage medium storing a computer program is provided, wherein when the computer program is executed by a processor, at least the following memory management method is implemented: based on the unused memory value and / or delay sensitivity of at least one first virtual machine to which memory has been allocated, predicting the unused memory value and / or delay sensitivity of a second virtual machine to which memory is to be allocated, wherein the delay sensitivity of the virtual machine indicates whether the virtual machine is sensitive to delay; based on the predicted unused memory value and / or delay sensitivity of the second virtual machine, pre-allocating the memory to be allocated of the second virtual machine. In addition, other methods of the present invention can also be similarly implemented by a computer-readable storage medium storing a computer program.

[0195] The storage medium may also include: one or more storage devices in the unit and / or device according to one or more example embodiments. One or more storage devices may be tangible or non-temporary computer-readable storage media (such as random access memory (RAM), read-only memory (ROM), permanent mass storage device (such as disk drive) and / or any other similar data storage structure capable of storing and recording data). One or more storage devices may be configured to store computer programs, program codes, instructions, or some combinations thereof for one or more operating systems and / or for implementing the example embodiments described herein. A drive mechanism may also be used to load a computer program, program code, instruction, or some combination thereof from a separate computer-readable storage medium to one or more storage devices and / or one or more computer processing devices. Such a separate computer-readable storage medium may include a universal serial bus (USB) flash drive, a memory stick, a Blu-ray / DVD / CD-ROM drive, a memory card, and / or other similar computer-readable storage media. A computer program, program code, instruction, or some combination thereof may be loaded from a remote data storage device to one or more storage devices and / or one or more computer processing devices via a network interface rather than via a computer-readable storage medium. In addition, the computer program, program code, instructions, or some combination thereof may be loaded from a remote computing system over a network into one or more storage devices and / or one or more processors, wherein the remote computing system is configured to transmit and / or distribute the computer program, program code, instructions, or some combination thereof over a network. The remote computing system may transmit and / or distribute the computer program, program code, instructions, or some combination thereof via a wired interface, an air interface, and / or any other suitable medium known to those skilled in the art.

[0196] One or more hardware devices, storage media, computer programs, program codes, instructions, or some combination thereof may be specially designed and constructed for the purposes of the example embodiments, or they may be known devices altered and / or modified for the purposes of the example embodiments.

[0197] The foregoing is an illustration of example embodiments and should not be construed as limiting the example embodiments. Although some example embodiments have been described, it will be readily appreciated by those skilled in the art that many modifications may be made in the example embodiments without substantially departing from the novel teachings and advantages of the example embodiments of the present invention. Therefore, all such modifications are intended to be included within the scope of the example embodiments of the present invention as defined in the claims. Therefore, it will be understood that the foregoing description is an illustration of various example embodiments and should not be construed as being limited to the specific example embodiments disclosed, and modifications to the disclosed example embodiments as well as other example embodiments are intended to be included within the scope of the appended claims.

Claims

1. A memory management method, comprising: predicting an unused memory value and / or a delay sensitivity of a second virtual machine to which memory is to be allocated based on an unused memory value and / or a delay sensitivity of at least one first virtual machine to which memory has been allocated, wherein the delay sensitivity of the corresponding virtual machine indicates whether the corresponding virtual machine is sensitive to delay based on whether a delay condition indicating that the corresponding virtual machine is sensitive to delay is satisfied; Based on the predicted unused memory value and / or delay sensitivity of the second virtual machine, the memory to be allocated of the second virtual machine is pre-allocated.

2. The memory management method according to claim 1, wherein: The step of predicting the unused memory value and / or delay sensitivity of the second virtual machine to which memory is to be allocated comprises: determining at least one similarity between memory usage information of the at least one first virtual machine and memory usage information of the second virtual machine, wherein the memory usage information of the corresponding virtual machine includes one or more of an identity of a customer corresponding to the corresponding virtual machine, a type of application corresponding to the corresponding virtual machine, a location of the customer, information of a processor specified by the corresponding virtual machine, and information of a memory specified by the corresponding virtual machine; Based on the at least one similarity and the unused memory value and / or the delay sensitivity of at least one first virtual machine, an unused memory value and / or a delay sensitivity of the second virtual machine is predicted.

3. The memory management method according to claim 2, wherein: The at least one first virtual machine includes n first virtual machines, where n is a positive integer. The step of predicting the unused memory value of the second virtual machine includes: Assigning n weights to the n unused memory values ​​of the n first virtual machines based on n similarities between the n pieces of memory usage information of the n first virtual machines and the memory usage information of the second virtual machine; The estimated unused memory value of the second virtual machine is predicted by performing a weighted average calculation based on the n unused memory values ​​of the n first virtual machines and the n weights corresponding to the n unused memory values.

4. The memory management method according to claim 2, wherein: The step of predicting the delay sensitivity of the second virtual machine includes: In response to the similarity indicating that the memory usage information of the second virtual machine is the same as the memory usage information of one or more first virtual machines of the at least one first virtual machine, determining whether the one or more first virtual machines are sensitive to latency; In response to a number of delay-sensitive first virtual machines among the one or more first virtual machines being greater than or equal to half the number of the one or more first virtual machines, predicting the delay sensitivity of the second virtual machine as delay-sensitive, and; In response to a number of delay-sensitive first virtual machines among the one or more first virtual machines being less than half the number of the one or more first virtual machines, the delay sensitivity of the second virtual machine is predicted to be delay-insensitive.

5. The memory management method according to claim 1, wherein: The step of pre-allocating the memory to be allocated of the second virtual machine includes: In response to only the delay sensitivity of the unused memory value and the delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is sensitive to delay, pre-allocating the to-be-allocated memory of the second virtual machine into the local memory; In response to only the unused memory value of the unused memory value and the delay sensitivity being predicted, pre-allocating predicted unused memory corresponding to the predicted unused memory value of the second virtual machine in the memory to be allocated of the second virtual machine into the pool memory, and pre-allocating the remaining memory of the memory to be allocated of the second virtual machine except the predicted unused memory into the local memory; and / or In response to both the unused memory value and the delay sensitivity being predicted and the predicted delay sensitivity of the second virtual machine indicating that the second virtual machine is not sensitive to delay, the predicted unused memory in the memory to be allocated of the second virtual machine is pre-allocated into the pool memory, and the remaining memory in the memory to be allocated of the second virtual machine except the predicted unused memory is pre-allocated into the local memory.

6. The memory management method according to claim 1, wherein: The memory management method further includes: Determining whether the unused memory in the allocated memory of the second virtual machine is overestimated by comparing the actual unused memory of the second virtual machine monitored when the second virtual machine is running with the unused memory in the allocated memory of the second virtual machine; In response to determining that unused memory in the allocated memory of the second virtual machine is overestimated, estimating whether the second virtual machine is sensitive to latency; and In response to the second virtual machine being estimated to be latency sensitive, unused memory of the second virtual machine is reallocated into the local memory.

7. The memory management method according to claim 6, wherein: The step of estimating whether the second virtual machine is sensitive to delay includes: Obtain a core performance measurement unit indicator of the at least one first virtual machine and a core performance measurement unit indicator of the second virtual machine; Determining N virtual machines in the at least one first virtual machine that are most similar to the second virtual machine in terms of delay related information by comparing the core performance measurement unit indicator of the at least one first virtual machine with the core performance measurement unit indicator of the second virtual machine, where N is a positive integer; and Based on determining whether a proportion of virtual machines with a delay-sensitive label among the N virtual machines is greater than or equal to a threshold, determining whether the second virtual machine is delay-sensitive.

8. The memory management method according to claim 6, wherein: The memory management method further includes: In response to the second virtual machine being estimated to be insensitive to latency; clustering data stored in the local memory of the second virtual machine into a plurality of groups according to program contexts and one or more access times of applications on the second virtual machine; One or more groups with the least average number of accesses among the plurality of groups are stored in the pool memory and / or one or more groups with the greatest average number of accesses among the plurality of groups are stored in the local memory.

9. The memory management method according to claim 1, wherein: The at least one first virtual machine is n virtual machines among the multiple first virtual machines to which memory has been allocated, which have memory usage information most similar to the memory usage information of the second virtual machine, wherein n is a positive integer, The memory usage information of the virtual machine includes one or more of the identity of the client corresponding to the virtual machine, the type of application corresponding to the virtual machine, the location of the client, information of the processor specified by the virtual machine, and information of the memory specified by the virtual machine.

10. A memory management device, comprising: A memory storing one or more instructions; as well as a processor operably coupled to the memory and configured to execute the one or more instructions, Wherein, when the processor executes the one or more instructions, the processor is configured to: predicting an unused memory value and / or a delay sensitivity of a second virtual machine to which memory is to be allocated based on an unused memory value and / or a delay sensitivity of at least one first virtual machine to which memory has been allocated, wherein the delay sensitivity of the virtual machine indicates whether the virtual machine is sensitive to delay based on whether a delay condition indicating that the corresponding virtual machine is sensitive to delay is satisfied; and Based on the predicted unused memory value and / or delay sensitivity of the second virtual machine, the memory to be allocated of the second virtual machine is pre-allocated.

11. A computer-readable storage medium having instructions stored therein, the instructions, when executed by a processor, causing the processor to perform a method, the method comprising: predicting an unused memory value and / or a delay sensitivity of a second virtual machine to which memory is to be allocated based on an unused memory value and / or a delay sensitivity of at least one first virtual machine to which memory has been allocated, wherein the delay sensitivity of the corresponding virtual machine indicates whether the corresponding virtual machine is sensitive to delay based on whether a delay condition indicating that the corresponding virtual machine is sensitive to delay is satisfied; Based on the predicted unused memory value and / or delay sensitivity of the second virtual machine, the memory to be allocated of the second virtual machine is pre-allocated.

Citation Information

Cited By

  • Solid state disk multi-level cache scheduling method and system

    CN120704873A