Soft-state memory processing method and device and product

By allocating soft-state memory within the operating system memory and managing it according to a heat value strategy, the problem of system performance degradation caused by improper memory management in aggregate computing is solved, achieving efficient memory utilization and improved system performance.

CN121900938APending Publication Date: 2026-04-21CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2025-11-26
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In a converged computing environment, how can we effectively manage soft-state memory to avoid system memory pressure and improve system performance?

Method used

By allocating soft-state memory within the operating system's memory and implementing dynamic management strategies based on the popularity value of memory pages, including updating popularity values ​​during read and write operations and periodically releasing infrequently used memory pages, memory overload can be avoided.

Benefits of technology

It effectively improves the processing performance of the aggregation host, avoids memory exhaustion issues, and enhances system stability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900938A_ABST
    Figure CN121900938A_ABST
Patent Text Reader

Abstract

The invention provides a soft-state memory processing method and device and a product, and belongs to the technical field of aggregation calculation. The method comprises the following steps: in response to a soft-state memory configuration operation, determining a soft-state memory in a memory of an operating system of the aggregation host, and mapping the soft-state memory to any application program of the operating system; according to the read-write operation of any application program in the operating system on any memory page in the soft-state memory, updating the heat value of the memory page; and executing a memory page release strategy, wherein the memory page release strategy is used for releasing the memory pages in the soft-state memory according to the heat value of each memory page in the soft-state memory. The invention aims to improve the performance of the system based on the soft-state memory on the premise of not causing the pressure of the system memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of aggregate computing, and more specifically, to a method, apparatus, and product for processing soft-state memory. Background Technology

[0002] Aggregated computing can combine multiple independent virtual machines or compute nodes into a unified large virtual machine or compute cluster. By integrating multiple computing resources, it provides a single computing environment with higher computing power, memory capacity, or storage space. It is suitable for high-performance computing, ultra-large-scale parallel computing, or application scenarios that require a large amount of resources. In the aggregated scenario, compute nodes can share a memory pool through the interconnect bus. Large virtual machines can use the CPU resources on each compute node and the large memory in the memory pool based on the interconnect bus.

[0003] Soft state is a concept in computer networks and distributed systems. For example, it allows data in a system to exist in an intermediate state without affecting overall availability. This data can accelerate the performance of an application if it is reused, but will not affect the operation of the application if it is not.

[0004] Using a portion of system memory as soft memory can effectively improve system performance. However, if all threads request soft memory indiscriminately, the system memory may be exhausted as the number of threads and the amount of data increase, resulting in a decrease in system performance or even memory crash.

[0005] Therefore, how to dynamically manage soft-state memory and improve system performance based on soft-state memory without putting pressure on system memory is an urgent problem to be solved. Summary of the Invention

[0006] This application provides a method, apparatus, and product for processing soft-state memory, aiming to improve system performance based on soft-state memory without causing system memory pressure.

[0007] In a first aspect, embodiments of this application provide a method for processing soft-state memory, applied to an aggregation host, the method comprising: In response to a soft state memory configuration operation, soft state memory is determined in the memory of the operating system of the aggregation host, and the soft state memory is mapped to any application of the operating system; Update the heat value of the memory page based on the read and write operations performed by any application in the operating system on any memory page in the soft state memory. A memory page release policy is executed, which is used to release memory pages in the soft state memory based on the heat value of each memory page in the soft state memory.

[0008] Optionally, in response to a soft-state memory configuration operation, determining soft-state memory in the operating system memory of the aggregation host includes: In response to a soft state memory configuration operation, a soft state memory configuration command is added to the command-line tool, the soft state memory configuration command including the memory size and starting address of the soft state memory; During the startup process of the operating system of the aggregation host, the soft state memory configuration command is executed to determine a soft state memory with the specified memory size and the specified starting address in the operating system's memory.

[0009] Optionally, in response to a soft-state memory configuration operation, after determining the soft-state memory in the operating system memory of the aggregation host, the method further includes: In response to the soft state memory query instruction, the starting address of the soft state memory is obtained and returned.

[0010] Optionally, mapping the soft state memory to any application of the operating system includes: Any application loads a shared library file to map the soft state memory into that application; the shared library file includes the mapping configuration for the soft state memory.

[0011] Optionally, the hotness value of a memory page is updated based on read / write operations performed by any application in the operating system on any memory page in the soft state memory, including: Monitor read and write operations performed by any application in the operating system on any memory page in the soft state memory; When any application performs a read or write operation on any memory page, the hotness value of that memory page is incremented by 1.

[0012] Optionally, a memory page release policy is implemented, including: When the utilization rate of the soft state memory exceeds a preset utilization rate threshold, at preset time intervals, memory pages to be released are determined based on the heat value of each memory page in the soft state memory. Determine whether any memory page to be freed is already in the freed queue; When any memory page to be released is already in the release queue, the memory page to be released is released so that it can be used by any application. If any memory page to be released is not in the release queue, then the memory page to be released is added to the release queue.

[0013] Optionally, the memory pages to be released are determined based on the heat values ​​of each memory page in the soft-state memory, including: Sort the memory pages in the soft state memory in descending order according to their popularity value. The first target number of memory pages in the sorted list will be the memory pages to be freed.

[0014] Optionally, the implementation of the memory page release policy also includes: When the queue to be released is full, multiple memory pages to be released are selected from the queue for use by any application.

[0015] Optionally, when the queue to be released is full, multiple memory pages to be released are selected from the queue, including: When the queue to be released is full, the second target number of memory pages at the front of the queue to be released are released for use by any application.

[0016] Optionally, the implementation of the memory page release policy also includes: Monitor the memory usage of the operating system; When the memory utilization rate of the operating system is greater than or equal to a preset first memory utilization rate threshold and less than a second memory utilization rate threshold, all memory pages to be released in the release queue are released as memory of the operating system.

[0017] Optionally, after monitoring the memory usage of the operating system, the method further includes: When the memory usage of the operating system is greater than or equal to the second memory usage threshold, the soft state memory is released as the operating system's memory.

[0018] Secondly, embodiments of this application provide a soft-state memory processing apparatus applied to an aggregation host, the apparatus comprising: A configuration module is configured to, in response to a soft-state memory configuration operation, determine soft-state memory in the memory of the operating system of the aggregation host and map the soft-state memory to any application of the operating system. The update module is used to update the hotness value of a memory page based on the read and write operations performed by any application in the operating system on any memory page in the soft state memory. The release module is used to execute a memory page release strategy, which is used to release memory pages in the soft state memory according to the heat value of each memory page in the soft state memory.

[0019] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the soft-state memory processing method as described in the first aspect of the embodiments.

[0020] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, they implement the soft-state memory processing method as described in the first aspect of the embodiments.

[0021] Fifthly, embodiments of this application provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the soft-state memory processing method described in the first aspect of the embodiments.

[0022] Beneficial effects: In the method provided in this application embodiment, in response to a soft state memory configuration operation, soft state memory is determined in the memory of the operating system of the aggregation host, and the soft state memory is mapped to any application of the operating system, thereby improving the processing performance of the aggregation host based on soft state memory, and avoiding the problem of the operating system running out of memory due to the application arbitrarily requesting soft state memory in the operating system's memory.

[0023] Furthermore, based on the read and write operations performed by any application in the operating system on any memory page in the soft state memory, the hotness value of the memory page is updated, and then the memory page release policy is executed. This allows memory pages in the soft state memory to be released based on the hotness value of each memory page in the soft state memory. Memory pages that have not been used for a long time or have been used less frequently can be released for normal memory use, reducing the memory pressure on the operating system. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a schematic diagram of an aggregated host architecture proposed in one embodiment of this application; Figure 2 This is a flowchart of the steps of a soft-state memory processing method proposed in an embodiment of this application; Figure 3 This is a schematic diagram of a soft-state memory provided in an embodiment of this application; Figure 4 This is a schematic diagram of memory page release according to an embodiment of this application; Figure 5 This is a functional block diagram of a soft-state memory processing device proposed in an embodiment of this application; Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application; Figure 7 This is a schematic diagram of a readable storage medium proposed in an embodiment of this application; Figure 8 This is a schematic diagram of a computer program product proposed in an embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0028] HPC: High-Performance Computing. A computing cluster is a system composed of multiple computing nodes connected together through a high-speed network. Through distributed computing technology, the computing cluster can be used as a whole to handle large-scale computing tasks. CXL: Compute Express Link is a cache-coherent interconnect technology standard protocol between processors and devices (such as accelerators, memory buffers, smart network interfaces, persistent memory, and solid-state drives) that can create a unified memory space for processors and devices to share data. Shared Library: A shared library is a type of library file in an operating system. In UNIX and UNIX-like systems (such as Linux), it usually ends with .so (Shared Object). It contains functions, variables, or other resources that can be used by multiple programs simultaneously, without having to compile these resources into each program's executable file separately. Shared libraries allow programs to be dynamically loaded and linked at runtime. They are loaded into memory only when the program runs, rather than being directly embedded into the program at compile time, thereby reducing memory usage and disk space consumption, and facilitating software updates and maintenance. LD_PRELOAD: This is an environment variable that allows users to specify a shared library when running a program. This shared library is loaded before the standard library. This is very useful for injecting custom code or replacing existing library functions at runtime. FIFO: First Input First Output, a first-in-first-out queue.

[0029] Aggregated computing is a computing model or technology in which multiple independent virtual machines or physical nodes are logically aggregated into a unified large virtual machine or computing entity. By integrating multiple computing resources (such as CPU, memory, etc.), it provides a single computing environment with higher computing power, memory capacity, or storage space. It is suitable for high-performance computing, ultra-large-scale parallel computing, or application scenarios that require a large amount of resources.

[0030] Reference Figure 1 The diagram illustrates an aggregated host architecture. Multiple compute nodes are aggregated into a large virtual machine by sharing a memory pool through an interconnect bus (such as CXL). The large virtual machine can use the CPU resources on each compute node and the large memory in the memory pool based on the interconnect bus. Each compute node can read and write the same memory data through the interconnect bus. Even if a memory is requested by another compute node first, the memory on this compute node will obtain the correct data as long as the cache consistency protocol is passed. When the CPU utilization of a certain thread on a certain compute node is too high, some of the threads can be scheduled to other nodes without causing serious performance degradation.

[0031] Soft state is a concept in computer networks and distributed systems, meaning that some states in the system can be temporary and do not need to be permanently stored in the system. These states can be dynamically updated, refreshed, or discarded when they expire. If these states are used again, they can accelerate the performance of the application; if not, they will not affect the operation of the application. For example, it allows data copies in the system to exist in intermediate states without affecting the overall availability.

[0032] For many applications, especially distributed applications such as databases and networks, using a portion of system memory as soft state memory to cache temporarily needed data can effectively improve system performance. However, if all threads request soft state memory without any restrictions, as the number of threads and the amount of data increase, the system memory may be exhausted, causing system performance to decline or even leading to memory crashes.

[0033] At the same time, when the operating system allocates a portion of memory specifically for soft state, if a thread uses less soft state memory, the system cannot use it normally, which will result in waste. In addition, some threads may store data that is not used for a long time, which will prevent other threads from making effective use of it, also resulting in waste.

[0034] Therefore, how to dynamically manage soft-state memory and improve system performance based on soft-state memory without putting pressure on system memory is an urgent problem to be solved.

[0035] The following description, in conjunction with the accompanying drawings, details a Hudi-based method for determining merged partitions provided in this application, through specific embodiments and application scenarios.

[0036] Reference Figure 2 This document illustrates a flowchart of a method for processing soft-state memory according to an embodiment of this application. The method is applied to an aggregation host and may specifically include the following steps: S101: In response to a soft state memory configuration operation, determine soft state memory in the memory of the operating system of the aggregation host, and map the soft state memory to any application of the operating system.

[0037] An aggregated host is a virtual machine formed by aggregating multiple compute nodes. During aggregation, the multiple compute nodes share memory based on the interconnect bus.

[0038] For example, the interconnect bus can be based on the CXL3.0 protocol. According to the CXL3.0 protocol, type 3 devices using the CXL3.0 protocol can read and write the same shared memory across multiple machines and can support cache consistency.

[0039] In one feasible implementation, the process of determining soft-state memory in the operating system memory of the aggregation host in response to a soft-state memory configuration operation may include: In response to a soft state memory configuration operation, a soft state memory configuration command is added to the command-line tool, the soft state memory configuration command including the memory size and starting address of the soft state memory; During the startup process of the operating system of the aggregation host, the soft state memory configuration command is executed to determine a soft state memory with the specified memory size and the specified starting address in the operating system's memory.

[0040] For example, in response to a soft-state memory configuration operation, the command-line tool cmdline is modified to add a soft-state memory configuration command, namely the memmap=nn!ss command. When the operating system starts, it needs to load the command-line tool cmdline, which will then execute the added memmap=nn!ss command, reserving a portion of the operating system's memory as soft-state memory. Here, nn is the size of the soft-state memory, and ss is the starting address of the soft-state memory.

[0041] After determining the soft-state memory in the operating system memory of the aggregation host in response to a soft-state memory configuration operation, the method further includes: In response to the soft state memory query instruction, the starting address of the soft state memory is obtained and returned.

[0042] Specifically, after reserving the soft state memory, the starting address of the soft state memory can be viewed using a soft state memory query command, such as dmesg | grepBIOS-e820.

[0043] After allocating soft state memory within the operating system's memory, the soft state memory can be further mapped to any application within the operating system.

[0044] Specifically, the reserved soft state memory exists in the form of pmem. The pmem can be converted into a dax device using the command ndctl create-namespace -f -e namespace0.0 -m devdax, and then the dax device corresponding to the soft state memory can be mapped to the application using mmap.

[0045] In actual implementation, a shared library file, i.e., an .so file, can be prepared in advance. The shared library file includes the mapping configuration of the soft state memory. That is, the soft state memory is mapped to the DAX device corresponding to it through mmap in the .so file. When any application loads the shared library file, i.e., the .so file, the soft state memory will be mapped to the application's virtual address space.

[0046] Furthermore, when writing the .so file, functions for managing soft state memory can be written in the .so file, which makes it convenient for each thread in any application to release and manage the soft state memory that it reads and writes. The .so file can also provide interface API functions for using soft state, such as soft hashes, soft data, and soft pointers.

[0047] Reference Figure 3 The diagram illustrates a soft-state memory provided in an embodiment of this application. The operating system's memory is a shared memory composed of multiple computing nodes based on an interconnect bus (such as CXL). A memory area is allocated in the operating system's memory for use as soft-state memory. When any application in the operating system loads the .so file at startup, it first maps the soft-state memory to the application's thread through mmap using the loaded .so file. When any thread needs to temporarily store a hash data, it can call the soft hash corresponding to the soft-state interface API function provided in the .so file to read and write the soft-state memory.

[0048] In actual implementation, various applications on the operating system can map soft state memory using mmap and then share the same soft state memory. The soft state memory can be divided into multiple memory pages in 4k increments. When any thread requests soft state memory through the API function provided in the .so file, memory pages of soft state memory can be allocated to the thread in multiples of 4k. In actual implementation, the division and allocation of soft state memory can be carried out according to the needs of the actual application. This application embodiment does not impose any restrictions.

[0049] S102: Update the heat value of the memory page based on the read and write operations performed by any application in the operating system on any memory page in the soft state memory.

[0050] The hotness value of a memory page can characterize how the memory page is used, such as the frequency of read and write operations.

[0051] In one feasible implementation, updating the hotness value of the memory page includes: Monitor read and write operations performed by any application in the operating system on any memory page in the soft state memory; when any application performs a read or write operation on any memory page, the heat value of that memory page is incremented by 1.

[0052] In actual implementation, the heat value of each memory page in the soft state memory can be stored in the reserved management area in the soft state memory. The size of the management area can be set according to the actual application needs. This application embodiment does not impose any restrictions. Furthermore, when memory pages are released in the future, the management area has the lowest release priority. That is, other memory pages in the soft state memory are released first, and the management area is released only when the entire soft state memory is released.

[0053] S103: Execute the memory page release policy, which is used to release memory pages in the soft state memory according to the heat value of each memory page in the soft state memory.

[0054] In one feasible implementation, the memory page release strategy is executed, including the following steps: A1: When the utilization rate of the soft state memory exceeds a preset utilization rate threshold, at preset time intervals, the memory pages to be released are determined based on the heat value of each memory page in the soft state memory.

[0055] When the usage rate of soft state memory exceeds a preset usage threshold, it indicates that there are many applications with soft state requirements. The system then begins to periodically release memory pages, releasing some memory pages with lower usage rates to make them available for applications with higher soft state requirements.

[0056] In actual implementation, the usage threshold and time interval can be set according to the needs of the actual application. For example, the usage threshold is set to 50% and the time interval is 1 minute. That is, when the usage of soft state memory exceeds 50%, the memory pages to be released are determined every 1 minute.

[0057] Specifically, when determining the memory pages to be released based on the heat value of each memory page in the soft state memory, the memory pages in the soft state memory can be sorted in descending order according to the heat value of each memory page in the soft state memory, and the first target number of memory pages in the sorted order can be used as the memory pages to be released.

[0058] After sorting the memory pages in descending order of popularity, the memory pages at the bottom of the list are read and written less frequently by threads. Therefore, the memory pages with lower popularity values ​​can be released for use by any application.

[0059] The first target number can be set according to the actual application requirements. For example, the first target number can be set to 20%, that is, the last 20% of memory pages are selected as memory pages to be released.

[0060] A2: Determine whether any memory page to be released is already in the release queue.

[0061] The unreleased queue provides a buffer for any memory page to be released, preventing it from being immediately reloaded after being released, and also preventing multiple threads from not having enough soft state memory to use.

[0062] A3: When any memory page to be released is already in the release queue, release the memory page to be released.

[0063] If a memory page to be freed was added to the freed queue in the previous cycle, then the memory page to be freed is released so that it can be used by any application.

[0064] A4: When any memory page to be released is not in the release queue, add the memory page to be released to the release queue.

[0065] If a memory page to be freed is not in the freed queue, then the memory page to be freed is newly identified and added to the freed queue.

[0066] Reference Figure 4 The diagram illustrates the memory page release provided in this application embodiment. Assuming that in two heat value checks at 1-minute intervals, in the first check, after sorting the heat values ​​of each memory page in descending order, the last 20% of memory pages are memory page 1, memory page 2, and memory page 3, and all of them are in the queue to be released. Therefore, memory page 1, memory page 2, and memory page 3 are added to the queue to be released.

[0067] In the second check, after sorting the memory pages by their popularity value in descending order, the last 20% of memory pages are: memory page 1, memory page 3, and memory page 6. Since memory page 1 and memory page 3 are already in the queue to be released, they are released for use by any application, and memory page 6 is added to the queue to be released.

[0068] In one feasible implementation, when the queue to be released is full, a number of memory pages to be released are selected from the queue. For example, when the queue to be released is full, a second target number of memory pages to be released at the top of the queue are released for use by any application.

[0069] In practice, the queue to be released can adopt FIFO, that is, first-in-first-out queue. When the queue to be released is full, the second target number of memory pages to be released can be released, that is, the memory pages that entered the queue to be released earlier are released.

[0070] The second target number can be set according to the actual application requirements. For example, the second target number can be set to 20%, which means releasing the top 20% of the memory pages in the release queue for use by any application.

[0071] In one feasible implementation, executing the memory page release policy further includes: Monitor the memory usage of the operating system; When the memory utilization rate of the operating system is greater than or equal to a preset first memory utilization rate threshold and less than a second memory utilization rate threshold, all memory pages to be released in the release queue are released as memory of the operating system.

[0072] When the memory usage of the operating system is greater than or equal to the second memory usage threshold, the soft state memory is released as the operating system's memory.

[0073] Specifically, the first memory usage threshold and the second memory usage threshold can be set according to the actual application requirements, and the first memory usage threshold is less than the second memory usage threshold.

[0074] When the operating system's memory usage is greater than or equal to a preset first memory usage threshold but less than a second memory usage threshold, it indicates that the operating system's memory is relatively tight. In order to avoid the operating system running out of memory, all memory pages waiting to be released in the release queue can be released for the operating system's memory use.

[0075] When the operating system's memory usage is greater than or equal to the second memory usage threshold, it indicates that the operating system's memory is very tight. In order to avoid the situation where the operating system's memory is completely exhausted, which would cause the system performance to degrade or even crash, soft memory can be released, that is, the entire soft memory can be used as the operating system's memory.

[0076] In practice, after releasing soft state memory, the memory address corresponding to the soft state memory can be mapped to the application via mmap, so that the application can treat the memory address as the operating system's memory and use it normally.

[0077] The method provided in this application determines soft state memory in the operating system memory of the aggregation host and maps the soft state memory to any application in the operating system, thereby improving the processing performance of the aggregation host based on the soft state memory and avoiding the problem of the operating system running out of memory due to the application arbitrarily requesting soft state memory in the operating system memory.

[0078] Then, it monitors the read and write operations performed by any application in the operating system on any memory page in the soft state memory, updates the hotness value of the memory page, and releases memory pages in the soft state memory periodically or when the operating system's memory is insufficient, based on the hotness value of each memory page in the soft state memory. It can release memory pages that have not been used for a long time or have been used less frequently for other applications to use, or use them as normal memory, reducing the memory pressure on the operating system. Moreover, this method is transparent to user applications and can effectively improve the performance of aggregate computing.

[0079] In actual implementation, a CXL3.0 shared memory environment is simulated on the local server using / pmem+qemu. Nested virtualization is enabled by executing echo Y> / sys / module / kvm_intel / parameters / nested on the server, and two virtual machines are started on the server as two computing nodes for aggregate computing.

[0080] In each virtual machine, the / pmem on the host machine was converted to a 40G DAX device using the ndctl command. Virtual machines were then launched on two compute nodes using qemu and aggregated into a large aggregate host, with 10G reserved as soft state memory. Tests were conducted on the aggregate host using three applications: memcached, SocialNet, and HDSearch, and the output bandwidth and latency were then tested.

[0081] According to the method described in the embodiments of this application, a shared library file hac.so that maps to soft-state memory is written. When the three applications start, LD_PRELOAD="hac.so" is added respectively to load the shared library file hac.so into the process of the application. After testing the output bandwidth and latency again, it can be observed that the bandwidth has increased by more than 50% on average and the latency has decreased by 30%, which significantly improves the performance of the system. After releasing the soft-state memory, this part of the memory address can be remapped to the virtual address space of the application to use this part of the memory normally.

[0082] Reference Figure 5 This diagram illustrates a functional block diagram of a soft-state memory processing apparatus according to an embodiment of this application. The apparatus includes: Configuration module 100 is configured to, in response to a soft state memory configuration operation, determine soft state memory in the memory of the operating system of the aggregation host and map the soft state memory to any application of the operating system; The update module 200 is used to update the hotness value of a memory page based on the read and write operations performed by any application in the operating system on any memory page in the soft state memory. The release module 300 is used to execute a memory page release strategy, which is used to release memory pages in the soft state memory according to the heat value of each memory page in the soft state memory.

[0083] Optionally, the configuration module is used for: In response to a soft state memory configuration operation, a soft state memory configuration command is added to the command-line tool, the soft state memory configuration command including the memory size and starting address of the soft state memory; During the startup process of the operating system of the aggregation host, the soft state memory configuration command is executed to determine a soft state memory with the specified memory size and the specified starting address in the operating system's memory.

[0084] Optionally, the device further includes a query module for: In response to the soft state memory query instruction, the starting address of the soft state memory is obtained and returned.

[0085] Optionally, the configuration module is used for: Any application loads a shared library file to map the soft state memory into that application; the shared library file includes the mapping configuration for the soft state memory.

[0086] Optionally, the update module is used to: Monitor read and write operations performed by any application in the operating system on any memory page in the soft state memory; When any application performs a read or write operation on any memory page, the hotness value of that memory page is incremented by 1.

[0087] Optionally, the release module is used for: When the utilization rate of the soft state memory exceeds a preset utilization rate threshold, at preset time intervals, memory pages to be released are determined based on the heat value of each memory page in the soft state memory. Determine whether any memory page to be freed is already in the freed queue; When any memory page to be released is already in the release queue, the memory page to be released is released so that it can be used by any application. If any memory page to be released is not in the release queue, then the memory page to be released is added to the release queue.

[0088] Optionally, the release module is further configured to: Sort the memory pages in the soft state memory in descending order according to their popularity value. The first target number of memory pages in the sorted list will be the memory pages to be freed.

[0089] Optionally, the release module is further configured to: When the queue to be released is full, multiple memory pages to be released are selected from the queue for use by any application.

[0090] Optionally, the release module is further configured to: When the queue to be released is full, the second target number of memory pages at the front of the queue to be released are released for use by any application.

[0091] Optionally, the release module is further configured to: Monitor the memory usage of the operating system; When the memory utilization rate of the operating system is greater than or equal to a preset first memory utilization rate threshold and less than a second memory utilization rate threshold, all memory pages to be released in the release queue are released as memory of the operating system.

[0092] Optionally, the release module is further configured to: When the memory usage of the operating system is greater than or equal to the second memory usage threshold, the soft state memory is released as the operating system's memory.

[0093] Reference Figure 6 The diagram illustrates an electronic device according to an embodiment of this application. The electronic device includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the soft-state memory processing method embodiment described above and achieve the same technical effect.

[0094] For example, when the program or instructions stored in the memory are executed by the processor, the specific steps include: in response to a soft-state memory configuration operation, determining soft-state memory in the memory of the operating system of the aggregation host, and mapping the soft-state memory to any application of the operating system; updating the hotness value of a memory page based on read / write operations performed by any application of the operating system on any memory page in the soft-state memory; and executing a memory page release policy, which is used to release memory pages in the soft-state memory based on the hotness values ​​of each memory page in the soft-state memory.

[0095] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0096] Reference Figure 7The diagram illustrates a readable storage medium provided in an embodiment of this application. The readable storage medium stores a program or instructions, which, when executed by a processor, implement the various processes of the above-described soft-state memory processing method embodiment and achieve the same technical effect.

[0097] For example, when a program or instruction stored on a readable storage medium is executed by a processor, the specific steps include performing the following: in response to a soft-state memory configuration operation, determining soft-state memory in the memory of the operating system of the aggregation host, and mapping the soft-state memory to any application of the operating system; updating the hotness value of a memory page based on read / write operations performed by any application of the operating system on any memory page in the soft-state memory; and executing a memory page release policy, which is used to release memory pages in the soft-state memory based on the hotness values ​​of each memory page in the soft-state memory.

[0098] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0099] Reference Figure 8 The diagram illustrates a computer program product provided in an embodiment of this application, including a computer program / instruction. When executed by a processor, the computer program / instruction implements the various processes of the above-described soft-state memory processing method embodiment and achieves the same technical effect.

[0100] For example, when a computer program / instruction is executed by a processor, specifically, in response to a soft-state memory configuration operation, soft-state memory is determined in the memory of the operating system of the aggregated host, and the soft-state memory is mapped to any application of the operating system; based on read / write operations performed by any application of the operating system on any memory page in the soft-state memory, the hotness value of that memory page is updated; and a memory page release policy is executed, which is used to release memory pages in the soft-state memory based on the hotness values ​​of each memory page in the soft-state memory.

[0101] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

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

[0103] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. The description of the embodiments above is only for the purpose of helping to understand the method and core idea of ​​this application. Those skilled in the art can make many forms under the guidance of this application without departing from the spirit and scope of protection of the claims, and all of these are within the protection scope of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of ​​this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for processing soft-state memory, characterized in that, Applied to an aggregation host, the method includes: In response to a soft state memory configuration operation, soft state memory is determined in the memory of the operating system of the aggregation host, and the soft state memory is mapped to any application of the operating system; Update the heat value of the memory page based on the read and write operations performed by any application in the operating system on any memory page in the soft state memory. A memory page release policy is executed, which is used to release memory pages in the soft state memory based on the heat value of each memory page in the soft state memory.

2. The method according to claim 1, characterized in that, In response to a soft-state memory configuration operation, determining soft-state memory in the operating system memory of the aggregation host includes: In response to a soft state memory configuration operation, a soft state memory configuration command is added to the command-line tool, the soft state memory configuration command including the memory size and starting address of the soft state memory; During the startup process of the operating system of the aggregation host, the soft state memory configuration command is executed to determine a soft state memory with the specified memory size and the specified starting address in the operating system's memory.

3. The method according to claim 1, characterized in that, In response to a soft-state memory configuration operation, after determining the soft-state memory in the operating system memory of the aggregation host, the method further includes: In response to the soft state memory query instruction, the starting address of the soft state memory is obtained and returned.

4. The method according to claim 1, characterized in that, Mapping the soft state memory to any application of the operating system includes: Any application loads a shared library file to map the soft state memory into that application; the shared library file includes the mapping configuration for the soft state memory.

5. The method according to claim 1, characterized in that, Update the hotness value of a memory page based on read / write operations performed by any application in the operating system on any memory page in the soft state memory, including: Monitor read and write operations performed by any application in the operating system on any memory page in the soft state memory; When any application performs a read or write operation on any memory page, the hotness value of that memory page is incremented by 1.

6. The method according to claim 1, characterized in that, Execute memory page release policies, including: When the utilization rate of the soft state memory exceeds a preset utilization rate threshold, at preset time intervals, memory pages to be released are determined based on the heat value of each memory page in the soft state memory. Determine whether any memory page to be freed is already in the freed queue; When any memory page to be released is already in the release queue, the memory page to be released is released so that it can be used by any application. If any memory page to be released is not in the release queue, then the memory page to be released is added to the release queue.

7. The method according to claim 6, characterized in that, Based on the heat value of each memory page in the soft-state memory, the memory pages to be released are determined, including: Sort the memory pages in the soft state memory in descending order according to their popularity value. The first target number of memory pages in the sorted list will be the memory pages to be freed.

8. The method according to claim 6, characterized in that, The execution of memory page release policies also includes: When the queue to be released is full, multiple memory pages to be released are selected from the queue for use by any application.

9. The method according to claim 8, characterized in that, When the queue to be released is full, multiple memory pages to be released are selected from the queue, including: When the queue to be released is full, the second target number of memory pages at the front of the queue to be released are released for use by any application.

10. The method according to claim 6, characterized in that, The execution of memory page release policies also includes: Monitor the memory usage of the operating system; When the memory utilization rate of the operating system is greater than or equal to a preset first memory utilization rate threshold and less than a second memory utilization rate threshold, all memory pages to be released in the release queue are released as memory of the operating system.

11. The method according to claim 10, characterized in that, After monitoring the memory usage of the operating system, the method further includes: When the memory usage of the operating system is greater than or equal to the second memory usage threshold, the soft state memory is released as the operating system's memory.

12. A processing apparatus for soft-state memory, characterized in that, Applied to an aggregation host, the device includes: A configuration module is configured to, in response to a soft-state memory configuration operation, determine soft-state memory in the memory of the operating system of the aggregation host and map the soft-state memory to any application of the operating system. The update module is used to update the hotness value of a memory page based on the read and write operations performed by any application in the operating system on any memory page in the soft state memory. The release module is used to execute a memory page release strategy, which is used to release memory pages in the soft state memory according to the hotness value of each memory page in the soft state memory.

13. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein when the program or instructions are executed by the processor, they implement the soft-state memory processing method as described in any one of claims 1-11.

14. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the soft-state memory processing method as described in any one of claims 1-11.

15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the method for processing soft-state memory as described in any one of claims 1-11.