A memory allocation method and device based on resource monitoring

By periodically acquiring server status and concurrent memory allocation, combined with read-write locks and pre-allocation mechanisms, the problem of low efficiency when starting virtual machines in large batches under traditional memory allocation methods is solved, and faster memory allocation and virtual machine startup are achieved.

CN112612573BActive Publication Date: 2024-08-27BEIJING LOONGSTORE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011495665.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-17
Publication Date
2024-08-27
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

In cluster virtualization, the traditional memory allocation method causes the startup of virtual machines in large batches to be very slow and the total time is also very long. This is mainly because the startup of virtual machines requires locking resources for a long time, resulting in seriality and long lock usage time.

Method used

By periodically obtaining the server cluster status, using the daemon management terminal to obtain the server status, using a concurrent method to obtain the server status, using read-write locks to achieve memory allocation, pre-allocating memory and updating the pre-allocated memory set according to memory usage, and selecting qualified The server allocates memory and automatically reclaims the pre-allocated memory after the virtual machine fails to start.

Benefits of technology

It improves the efficiency of starting virtual machines in large batches, reduces virtual machine startup time, optimizes the memory allocation process through concurrency and pre-allocation mechanisms, and avoids lock seriality issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112612573B
    Figure CN112612573B
Patent Text Reader

Abstract

The present invention provides a memory allocation method and device based on resource monitoring, the method comprising: periodically obtaining the status of each server in a server cluster, each server in the server cluster is installed with a daemon process, the daemon process is used for the management end to obtain the status of the server; a memory allocator allocates memory according to the status of each server and a pre-allocated memory set; the server status includes the memory usage of the server, the memory change is determined according to the last and current memory usage, and when the memory is counted, the pre-allocated memory set in the memory allocator is updated to recycle the pre-allocated memory. The application increases the efficiency of starting virtual machines in batches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a virtualization service, and in particular to a memory allocation method and device based on resource monitoring, belonging to the field of cloud computing systems. Background Art

[0002] In cluster virtualization, in order to make the most rational use of resources, when starting a virtual machine, you should choose a server with the most idle resources to start the virtual machine. Generally, memory is the core of virtualization, so memory is the main focus when allocating it.

[0003] The traditional allocation method is to add a memory master lock based on the current virtualized memory situation. Whenever a virtual machine needs to obtain memory resources, it obtains the master lock, and then uses a weighted algorithm to calculate the optimal physical machine, start the virtual machine, change the memory, and release the master lock. The traditional implementation method has a major flaw. Since it takes a certain amount of time to start a virtual machine, the lock will be used for a long time. In addition, the serial nature of the lock will cause the virtual machine to start very slowly and the total time will be very long when starting a large number of virtual machines (storm startup). Summary of the invention

[0004] In order to solve the problem that the startup of virtual machines is very slow and the total time is very long when starting a large number of virtual machines (storm startup), the embodiment of the present application provides a memory allocation method and device based on resource monitoring.

[0005] In a first aspect, an embodiment of the present application provides a memory allocation method based on resource monitoring, comprising:

[0006] Periodically obtaining the status of each server in the server cluster, each server in the server cluster is installed with a daemon process, and the daemon process is used by the management end to obtain the status of the server;

[0007] The memory allocator allocates memory based on each server's state and the pre-allocated memory set;

[0008] The state of the server includes the memory usage of the server. The memory change is determined according to the memory usage of the last time and the current time. When the memory is counted, the pre-allocated memory set in the memory allocator is updated to reclaim the pre-allocated memory.

[0009] Among them, it also includes:

[0010] Recording the allocation time of the pre-allocated memory of the first virtual machine;

[0011] It is detected whether the first virtual machine is started normally. If it is not started normally, the pre-allocated memory of the first virtual machine is automatically recovered after a preset period, and the preset period is calculated from the allocation time of the pre-allocated memory of the first virtual machine.

[0012] Among them, obtaining the status of each server in the server cluster includes:

[0013] Use concurrent method to obtain the status of each server in the server cluster.

[0014] The memory allocator allocates memory according to the state of each server and the pre-allocated memory set, including:

[0015] Use read-write locks to implement locks in memory allocators;

[0016] After entering the lock, calculate how much memory is left on each server based on the pre-allocated memory and the memory usage in the acquired server status;

[0017] Select a server that meets the preset conditions based on the requested memory amount and the memory weight on each server;

[0018] After selecting a server that meets the preset conditions, the memory allocator adds the information of the current memory to the pre-allocated memory set, and the memory allocator completes the memory allocation.

[0019] In a second aspect, the present application provides a memory allocation device based on resource monitoring, comprising:

[0020] An acquisition unit, used for periodically acquiring the status of each server in the server cluster, each server in the server cluster is installed with a daemon process, and the daemon process is used for the management end to acquire the status of the server;

[0021] A memory allocator that allocates memory based on each server's state and pre-allocated memory set;

[0022] The updating unit is used for the server status including the memory usage of the server, determining the memory change according to the last and current memory usage, and updating the pre-allocated memory set in the memory allocator during memory statistics to reclaim the pre-allocated memory.

[0023] It also includes a self-expiring unit for:

[0024] Recording the allocation time of the pre-allocated memory of the first virtual machine;

[0025] It is detected whether the first virtual machine is started normally. If it is not started normally, the pre-allocated memory of the first virtual machine is automatically recovered after a preset period, and the preset period is calculated from the allocation time of the pre-allocated memory of the first virtual machine.

[0026] Wherein, the acquisition unit is used to:

[0027] Use concurrent method to obtain the status of each server in the server cluster.

[0028] Wherein, the memory allocator is used for:

[0029] Use read-write locks to implement locks in memory allocators;

[0030] After entering the lock, calculate how much memory is left on each server based on the pre-allocated memory and the memory usage in the acquired server status;

[0031] Select a server that meets the preset conditions based on the requested memory amount and the memory weight on each server;

[0032] After selecting a server that meets the preset conditions, the memory allocator adds the information of the current memory to the pre-allocated memory set, and the memory allocator completes the memory allocation.

[0033] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the above methods when executed by a processor.

[0034] In a fourth aspect, an embodiment of the present application provides a server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the program.

[0035] The memory allocation method and device based on resource monitoring in the embodiment of the present application have the following beneficial effects:

[0036] The memory allocation method based on resource monitoring of the present application includes: periodically obtaining the status of each server in the server cluster, each server in the server cluster is installed with a daemon process, and the daemon process is used by the management end to obtain the status of the server; the memory allocator allocates memory according to the status of each server and the pre-allocated memory set; the server status includes the memory usage of the server, and the memory change is determined according to the last and current memory usage. When the memory is counted, the pre-allocated memory set in the memory allocator is updated to recycle the pre-allocated memory. The present application increases the efficiency of starting virtual machines in large quantities. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flowchart of a memory allocation method based on resource monitoring according to an embodiment of the present application;

[0038] Figure 2 Another flowchart of the memory allocation method based on resource monitoring according to an embodiment of the present application is shown;

[0039] Figure 3 This is a schematic diagram of the structure of a memory allocation device based on resource monitoring according to an embodiment of the present application;

[0040] Figure 4 This is a schematic diagram of the structure of the server of the embodiment of the present application. DETAILED DESCRIPTION

[0041] The present application is further described below in conjunction with the accompanying drawings and embodiments.

[0042] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present invention, and different embodiments can be replaced or combined, so this application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then this application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, even though the embodiment may not be clearly recorded in the following text.

[0043] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.

[0044] In cluster virtualization, in order to make the most rational use of resources, when starting a virtual machine, you should choose a server with the most idle resources to start the virtual machine. Generally, memory is the core of virtualization, so memory is the main focus when allocating it.

[0045] The traditional allocation method is to add a memory master lock based on the current virtualized memory situation. Whenever a virtual machine needs to obtain memory resources, it obtains the master lock, and then uses a weighted algorithm to calculate the optimal physical machine, start the virtual machine, change the memory, and release the master lock. The traditional implementation method has a major flaw. Since it takes a certain amount of time to start a virtual machine, the lock will be used for a long time. In addition, the serial nature of the lock will cause the virtual machine to start very slowly and the total time will be very long when starting a large number of virtual machines (storm startup).

[0046] In order to solve the defects of traditional implementations and improve the efficiency of Storm startup, the present invention discovers that the core point is that requesting resources and starting virtual machines are mutually exclusive. It first occupies resources to release locks through pre-allocation, and then verifies the correctness of pre-allocation through monitoring, thereby achieving concurrency in requesting resources and using resources and increasing the efficiency of Storm startup.

[0047] like Figure 1-2 As shown, the memory allocation method based on resource monitoring of the present application includes the following steps: S101, periodically obtaining the status of each server in the server cluster, each server in the server cluster is installed with a daemon process, and the daemon process is used by the management end to obtain the status of the server; S103, the memory allocator allocates memory according to the status of each server and the pre-allocated memory set; S105, the status of the server includes the memory usage of the server, and the memory change is determined according to the last and current memory usage. When the memory is counted, the pre-allocated memory set in the memory allocator is updated to recycle the pre-allocated memory. Each step is described below.

[0048] S101, periodically obtaining the status of each server in the server cluster. Each server in the server cluster is installed with a daemon process, and the daemon process is used by the management end to obtain the status of the server.

[0049] In this step, a concurrent method is used to obtain the status of each server in the server cluster. Server cluster monitoring: First, there must be a stable and timed way to obtain monitoring information. Referring to the traditional Internet method, the present invention uses the C / S (client / server) architecture at this point. A daemon is installed on each server, and the management end can obtain the status of each server in real time. The management end uses scheduled tasks to implement resource acquisition. In order to increase the accuracy of acquisition and reduce the time for obtaining information in a single cycle, a concurrent method is used to acquire resources. After acquiring the resource set, all server memories will be updated at the same time.

[0050] S103, the memory allocator allocates memory according to the state of each server and the pre-allocated memory set.

[0051] In some embodiments, this step includes using a read-write lock to implement a lock in a memory allocator; after entering the lock, calculating how much memory is left on each server based on the pre-allocated memory and the memory usage in the acquired server status; selecting a server that meets the preset conditions based on the amount of memory requested and the memory weight on each server; after selecting a server that meets the preset conditions, the memory allocator adds information about the current memory to the pre-allocated memory set, and the memory allocator completes the memory allocation.

[0052] Memory allocator: There are two main aspects of memory allocation. One is the monitoring information, and the other is the pre-allocated memory set in the memory allocator. Since the memory allocator is to be accessed by multiple benefiting clients and to ensure the uniqueness of memory allocation, the memory allocator needs to implement a lock mechanism. The present invention uses a large read-write lock to implement the lock in the memory allocator. After entering the lock, there will be a pre-allocated memory and the existing monitoring memory to merge to calculate how much memory is theoretically left on each server. The present invention also has a detail. The optimal set of memory is implemented using a percentage weight, that is, the lower the percentage memory usage, the more optimal it is. According to the existing amount of memory to be applied for and the memory weight on each machine, the optimal machine is selected. After selecting the optimal machine, the memory allocator will add the information of the current memory to the pre-allocated memory set. After completing all the above problems, the memory allocator completes the memory allocation.

[0053] S105, the state of the server includes the memory usage of the server. The memory change is determined according to the last and current memory usage. When the memory is counted, the pre-allocated memory set in the memory allocator is updated to reclaim the pre-allocated memory.

[0054] In some embodiments, the present invention further includes: recording the allocation time of the pre-allocated memory of the first virtual machine; detecting whether the first virtual machine is started normally, if it is not started normally, the pre-allocated memory of the first virtual machine is automatically reclaimed after a preset period, and the preset period is calculated from the allocation time of the pre-allocated memory of the first virtual machine. Figure 2 As shown, A and B are virtual machines that start normally, C and D are virtual machines that fail to start, and the memory of C and D adopts a self-expiration mechanism. After the preset period arrives, the memory of C and D is automatically reclaimed.

[0055] Regarding the problem of reclaiming pre-allocated memory, the present invention mainly adopts two methods:

[0056] The first is completed through the monitoring feedback mechanism. When obtaining server information, the agreed server will return the complete memory usage of the current service. According to the last and current memory usage, the memory changes can be clearly understood. Therefore, when the memory statistics are collected, the pre-allocated memory set in the memory allocator is updated to achieve the purpose of reclaiming the pre-allocated memory.

[0057] The second is to use the pre-allocated memory self-expiration mechanism. Since the pre-allocated memory is reserved in advance, after the actual monitoring feedback, the new memory mechanism is already known, and all pre-allocations should be cleared. However, in reality, due to the existence of multiple threads, statistics and allocation may be carried out at the same time, so it is impossible to clear all pre-allocations, so the feedback mechanism only clears known pre-allocations. In reality, there may be two situations: one is that it is in use, which can be corrected through the next feedback. The other is that it fails to be used, and the self-expiration mechanism must be used here to implement it. The self-expiration mechanism is essentially that after the pre-allocated memory is allocated, it is believed that it will be recycled by the feedback mechanism within a certain period of time. If it is not recycled, it is considered to be self-reclaimed. By recording the allocation time of the pre-allocated memory, the self-expiration mechanism can be easily implemented. The self-expiration mechanism well unifies the abnormal situations that need to be handled after many memory allocations, greatly reducing the judgment and processing of situations in the actual architecture and simplifying the programming model.

[0058] This application is based on a memory allocation method for resource monitoring, which is mainly used for pooled memory resources formed by more than one server. When any client applies for memory resources, it selects available resource servers, pre-allocates memory, monitors and determines, and recycles pre-allocation. In this application:

[0059] Server cluster statistics process: obtains information about the server's memory resources at fixed intervals, counts the total memory of the server cluster pool, and obtains server information concurrently through multiple threads, which greatly shortens the acquisition time; uses unified update to update the information uniformly after all information is obtained.

[0060] Client beneficiary: Any process that needs to use memory resources.

[0061] Memory allocator: The client can obtain pooled resources through the memory allocator. The memory can only be obtained by a single client, but the efficiency of the acquisition can be guaranteed.

[0062] In this application, a real-time monitoring process is installed on each server and aggregated to the master control server through a private protocol. According to the real-time pooled resource situation and the self-selected selection algorithm, the appropriate memory block is selected and allocated to the client, and the pre-allocated memory and the allocation time of this memory need to be recorded.

[0063] In this application, the feedback mechanism based on resource monitoring is used to truly allocate and reclaim actual memory, and the pre-allocated memory is cleared or used by monitoring the real-time situation and the pre-allocation of memory allocation.

[0064] The present invention proposes a memory allocation method based on resource monitoring, which is mainly used for pooled memory resources formed by more than one server. When any benefiting client applies for memory resources, the process of selecting available resource servers, pre-allocating memory, monitoring and determining and pre-allocation recovery is carried out. That is, the resource pool will collect the usage of memory resources regularly. When the benefiting client applies for memory resources and enters the resource application factory, the factory will pre-allocate according to the current memory usage, and will release the factory immediately after pre-allocation; the timed resource collector will collect the actual memory usage status each time, and release the excess memory for the benefiting client that has actually applied; for the benefiting client that has successfully applied but has not actually used the memory, the memory resources are recycled through the automatic expiration mechanism. The present application can effectively reduce the time for the benefiting client to apply for resources while ensuring the correct allocation of memory resources, thereby increasing the efficiency of the benefiting client applying for memory resources per unit time.

[0065] like Figure 3 As shown, the present application provides a memory allocation device based on resource monitoring, comprising:

[0066] The acquisition unit 201 is used to periodically acquire the status of each server in the server cluster. Each server in the server cluster is installed with a daemon process, and the daemon process is used for the management end to acquire the status of the server;

[0067] A memory allocator 202, configured to allocate memory according to the state of each server and the pre-allocated memory set;

[0068] The updating unit 203 is used for the server status including the memory usage of the server, and determines the memory change according to the last and current memory usage. When the memory is counted, the pre-allocated memory set in the memory allocator is updated to reclaim the pre-allocated memory.

[0069] It also includes a self-expiring unit for:

[0070] Recording the allocation time of the pre-allocated memory of the first virtual machine;

[0071] It is detected whether the first virtual machine is started normally. If it is not started normally, the pre-allocated memory of the first virtual machine is automatically recovered after a preset period, and the preset period is calculated from the allocation time of the pre-allocated memory of the first virtual machine.

[0072] The acquisition unit is used to:

[0073] Use concurrent method to obtain the status of each server in the server cluster.

[0074] Among them, the memory allocator is used to:

[0075] Use read-write locks to implement locks in memory allocators;

[0076] After entering the lock, calculate how much memory is left on each server based on the pre-allocated memory and the memory usage in the acquired server status;

[0077] Select a server that meets the preset conditions based on the requested memory amount and the memory weight on each server;

[0078] After selecting the server that meets the preset conditions, the memory allocator adds the information of the current memory to the pre-allocated memory set, and the memory allocator completes the memory allocation.

[0079] In the present application, an embodiment of a memory allocation device based on resource monitoring is substantially similar to an embodiment of a memory allocation method based on resource monitoring. For related details, please refer to the introduction of the embodiment of a memory allocation method based on resource monitoring.

[0080] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present invention can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, FPGA (Field-Programmable Gate Array), IC (Integrated Circuit), etc.

[0081] Each processing unit and / or module of the embodiment of the present invention may be implemented by an analog circuit that realizes the functions described in the embodiment of the present invention, or may be implemented by software that executes the functions described in the embodiment of the present invention.

[0082] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the memory allocation method based on resource monitoring are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0083] Figure 4 This is a schematic diagram of the structure of the server in the embodiment of the present application, such as Figure 4As shown, the server of the present application includes a processor 401, a memory 402, an input device 403, and an output device 404. The processor 401, the memory 402, the input device 403, and the output device 404 can be connected via a bus 405 or other means. The memory 402 stores a computer program, which can be run on the processor 401, and when the processor 401 executes the program, the above-mentioned memory allocation method steps based on resource monitoring are implemented.

[0084] The input device 403 can receive input digital or character information and generate key signal input related to user settings and function control of the data processing server, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a track ball, a joystick, etc. The output device 404 may include a display device, an auxiliary lighting device (e.g., an LED), a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, a plasma display, and a touch screen.

[0085] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0086] In the embodiments of the present invention, all functional units may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A memory allocation method based on resource monitoring, characterized in that: include: Periodically obtaining the status of each server in the server cluster, each server in the server cluster is installed with a daemon process, and the daemon process is used by the management end to obtain the status of the server; The memory allocator allocates memory based on each server's state and the pre-allocated memory set; The server status includes the memory usage of the server. The memory change is determined based on the last and current memory usage. When the memory is counted, the pre-allocated memory set in the memory allocator is updated to recycle the pre-allocated memory. After the pre-allocated memory is allocated, it is considered that it will be recycled by the feedback mechanism within a certain period of time. If it is not recycled, it is considered that it can be recycled by itself. For the benefiting clients that have successfully applied for but have not actually used the memory, the memory resources are recycled through the automatic expiration mechanism. Also includes: Recording the allocation time of the pre-allocated memory of the first virtual machine; It is detected whether the first virtual machine is started normally. If it is not started normally, the pre-allocated memory of the first virtual machine is automatically recovered after a preset period, and the preset period is calculated from the allocation time of the pre-allocated memory of the first virtual machine.

2. The memory allocation method based on resource monitoring according to claim 1, characterized in that: Get the status of each server in the server cluster, including: Use concurrent method to obtain the status of each server in the server cluster.

3. The memory allocation method based on resource monitoring according to claim 1 or 2, characterized in that: The memory allocator allocates memory according to the state of each server and the pre-allocated memory set, including: Use read-write locks to implement locks in memory allocators; After entering the lock, calculate how much memory is left on each server based on the pre-allocated memory and the memory usage in the acquired server status; Select a server that meets the preset conditions based on the requested memory amount and the memory weight on each server; After selecting a server that meets the preset conditions, the memory allocator adds the information of the current memory to the pre-allocated memory set, and the memory allocator completes the memory allocation.

4. A memory allocation device based on resource monitoring, characterized in that: include: An acquisition unit, used for periodically acquiring the status of each server in the server cluster, each server in the server cluster is installed with a daemon process, and the daemon process is used for the management end to acquire the status of the server; A memory allocator that allocates memory based on each server's state and pre-allocated memory set; An updating unit, used for the server status including the memory usage of the server, determining the memory change according to the last and current memory usage, and updating the pre-allocated memory set in the memory allocator during memory statistics to reclaim the pre-allocated memory; Also includes self-expiring units for: Recording the allocation time of the pre-allocated memory of the first virtual machine; Detect whether the first virtual machine is started normally. If it is not started normally, the pre-allocated memory of the first virtual machine is automatically recovered after a preset period, and the preset period is calculated from the allocation time of the pre-allocated memory of the first virtual machine; after the pre-allocated memory is allocated, it is considered that it will be recovered by the feedback mechanism within a certain period of time. If it is not recovered, it is considered that it can be self-recovered; for the benefiting client that has successfully applied but has not actually used the memory, the memory resources are recovered through the automatic expiration mechanism.

5. The memory allocation device based on resource monitoring according to claim 4 is characterized in that: The acquisition unit is used to: Use concurrent method to obtain the status of each server in the server cluster.

6. The memory allocation device based on resource monitoring according to claim 4 or 5, characterized in that: The memory allocator is used to: Use read-write locks to implement locks in memory allocators; After entering the lock, calculate how much memory is left on each server based on the pre-allocated memory and the memory usage in the acquired server status; Select a server that meets the preset conditions based on the requested memory amount and the memory weight on each server; After selecting a server that meets the preset conditions, the memory allocator adds the information of the current memory to the pre-allocated memory set, and the memory allocator completes the memory allocation.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 3 are implemented.

8. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method described in any one of claims 1 to 3 are implemented.