Memory optimization method, electronic device, and computer program product
By constructing a memory page access graph and analyzing the behavior characteristics of allocation sources, the source of hot memory pages can be accurately identified, and fine-grained optimization strategies can be generated. This solves the problem of difficulty in identifying hot data in traditional memory management and improves memory performance and system responsiveness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN UNIV
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional memory management mechanisms lack fine-grained awareness of application memory access patterns, making it difficult to accurately identify hot data, resulting in poor memory locality or frequent page swapping, and failing to effectively alleviate performance bottlenecks in complex applications.
By constructing a memory page access graph, hot memory pages are identified. By combining the mapping relationship between memory pages and allocation sources, the source of hot memory pages is traced. The behavior characteristics of allocation sources and the local access subgraph of hot pages are used for joint analysis to generate fine-grained optimization strategies, including memory allocation, prefetching and migration operations.
Significantly reduces memory latency, improves cache hit rate, reduces I/O resource contention, effectively alleviates local performance bottlenecks, and enhances system scalability and deterministic response.
Smart Images

Figure CN121301038B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a memory optimization method, electronic device, and computer program product. Background Technology
[0002] As data centers continue to expand, the demand for memory capacity and performance is increasing. Remote memory (or memory decoupling) technology, as an effective memory resource pooling solution, has become a research hotspot in both industry and academia. Traditional memory management mechanisms typically employ globally uniform strategies for page replacement, prefetching, and allocation, lacking fine-grained awareness of application memory access patterns. This leads to problems such as difficulty in accurately identifying hot data, poor memory locality, or frequent page swapping. Furthermore, in complex applications, memory objects generated by different code paths often exhibit significantly different access behaviors, but existing technologies struggle to attribute abnormal memory access to specific allocation sources. Summary of the Invention
[0003] This disclosure provides a memory optimization method, an electronic device, and a computer program product.
[0004] According to one aspect of this disclosure, a memory optimization method is provided, comprising: filtering memory pages in a memory page access graph based on memory access frequency to determine hot memory pages, the memory access graph including the access order of memory pages; determining a set of candidate allocation sources that have performed memory allocation operations on the hot memory pages based on a mapping relationship between memory pages and memory page allocation sources; determining allocation source behavior characteristics of candidate allocation sources in the candidate allocation source set based on a mapping relationship between memory page allocation sources and allocation source behavior characteristics, the allocation source behavior characteristics including historical memory allocation characteristics of the memory page allocation sources; filtering candidate allocation sources in the candidate allocation source set based on the allocation source behavior characteristics and the access subgraph of the hot memory pages to determine a target allocation source, the access subgraph being the topology of the hot memory pages in the memory page access graph; and determining a memory optimization strategy for optimizing memory based on the allocation source behavior characteristics of the target allocation source and the access subgraph of the hot memory pages.
[0005] Based on one memory optimization method, frequently accessed hot memory pages are identified by analyzing the access frequency and order relationships recorded in the memory page access graph. By combining the mapping relationship between memory pages and memory page allocation sources, candidate allocation sources for hot memory pages are determined, thus attributing runtime access behavior to specific memory allocation locations. Historical memory allocation characteristics of each candidate allocation source are obtained by querying an allocation source behavior feature library. Combined with the local access subgraph of hot memory pages, candidate allocation sources are filtered to accurately locate the target allocation source most likely to cause hotspots. Based on this target allocation source and its behavioral characteristics, differentiated memory optimization strategies are dynamically generated. This approach overcomes the limitations of traditional operating systems' coarse-grained memory management, which operates on a single-page basis and lacks context awareness. It achieves a leap from passive response to proactive prediction and precise control, effectively reducing memory latency, improving cache hit rate, and reducing I / O resource contention.
[0006] According to at least one embodiment of the memory optimization method of this disclosure, a memory optimization strategy is determined for memory optimization based on the allocation source behavior characteristics of the target allocation source and the access subgraph of the hot memory page, including: determining the target memory page corresponding to the target allocation source based on the mapping relationship between memory pages and memory page allocation sources; storing the target memory page in a target memory pool, the target memory pool being used to store the physical memory space of the memory pages of the target allocation source; and, in response to a memory allocation request from the target allocation source, determining a memory page from the target memory pool for memory allocation.
[0007] According to at least one embodiment of the memory optimization method of this disclosure, a memory optimization strategy is determined for optimizing memory based on the allocation source behavior characteristics of the target allocation source and the access subgraph of the hot memory page, including: determining the data structure type of the target allocation source based on the target allocation source and the corresponding allocation source behavior characteristics; and determining the memory optimization strategy based on the data structure type of the target allocation source and the access subgraph.
[0008] According to at least one embodiment of the memory optimization method of this disclosure, a memory optimization strategy is determined based on the data structure type of the target allocation source and the access subgraph, including: determining a first memory page and a second memory page in the access subgraph with edge weights greater than a weight threshold, the first memory page pointing to the second memory page based on the access order; and asynchronously prefetching the second memory page in response to a memory swap-in request for the first memory page, loading the second memory page into a prefetch buffer.
[0009] According to at least one embodiment of the memory optimization method of this disclosure, a memory optimization strategy is determined for memory optimization based on the allocation source behavior characteristics of the target allocation source and the access subgraph of the hot memory pages, including: determining the confidence level of memory pages in the access subgraph based on the edge weights, access order and / or access time of memory pages in the access subgraph; filtering memory pages in the access subgraph based on the confidence level to determine a target memory page group with a confidence level greater than a confidence level threshold; and swapping out the target memory page group in response to a memory swapping-out request.
[0010] According to at least one embodiment of the memory optimization method of this disclosure, based on memory access frequency, memory pages in a memory page access graph are filtered to determine hot memory pages, including: traversing the edge weights of memory pages in the memory page access graph to determine the memory access frequency of the memory pages in a target time period; and based on the memory access frequency, the memory pages in the memory page access graph are filtered to determine hot memory pages whose memory access frequency is greater than a hot page threshold.
[0011] According to at least one embodiment of the memory optimization method of this disclosure, a target allocation source is determined by filtering candidate allocation sources in the candidate allocation source set based on the allocation source behavior features and the access subgraph of the hot memory pages. The method includes: extracting features from the access subgraph of the hot memory pages to determine a memory access feature vector; calculating the similarity between the allocation source behavior features and the memory access feature vector to determine the similarity between candidate allocation sources in the candidate allocation source set; and filtering candidate allocation sources in the candidate allocation source set based on the similarity to determine the target allocation source.
[0012] According to at least one embodiment of the memory optimization method of this disclosure, before filtering memory pages in a memory page access graph based on memory access frequency to determine hot memory pages, the method includes: in response to a memory operation request, performing feature extraction on the memory operation request based on a time window to determine memory operation features; and constructing or updating a memory page access graph based on the memory operation features.
[0013] According to at least one embodiment of the memory optimization method of this disclosure, before determining a set of candidate allocation sources for which memory allocation operations have been performed on the hot memory page based on the mapping relationship between memory pages and memory page allocation sources, the method includes: in response to a memory allocation request, determining the metadata of the allocated memory page, the metadata including the allocation source, a unique identifier of the metadata, allocation time, allocation size and / or a unique identifier of the memory page; and determining the mapping relationship between the memory page and the memory page allocation source based on the metadata.
[0014] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, causing the processor to perform a memory optimization method according to any embodiment of this disclosure.
[0015] According to another aspect of this disclosure, a readable storage medium is provided, wherein executable instructions are stored therein, which, when executed by a processor, are used to implement a memory optimization method according to any embodiment of this disclosure.
[0016] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a memory optimization method according to any embodiment of this disclosure. Attached Figure Description
[0017] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0018] Figure 1 This is a schematic diagram illustrating an application scenario of a memory optimization method according to one embodiment of the present disclosure.
[0019] Figure 2 This is a schematic diagram of the overall process of a memory optimization method according to one embodiment of the present disclosure.
[0020] Figure 3 This is a schematic flowchart illustrating the construction or updating of a memory page access graph in a memory optimization method according to one embodiment of the present disclosure.
[0021] Figure 4 This is a flowchart illustrating the process of identifying hot memory pages in a memory optimization method according to one embodiment of the present disclosure.
[0022] Figure 5 This is a flowchart illustrating the process of determining the mapping relationship between memory pages and memory page allocation sources in a memory optimization method according to one embodiment of this disclosure.
[0023] Figure 6 This is a flowchart illustrating the process of determining a target allocation source in a memory optimization method according to one embodiment of the present disclosure.
[0024] Figure 7 This is a flowchart illustrating the process of determining a memory optimization strategy in a memory optimization method according to one embodiment of the present disclosure.
[0025] Figure 8 This is a schematic diagram of the overall process for determining a memory optimization strategy in a memory optimization method according to another embodiment of this disclosure.
[0026] Figure 9 This is a flowchart illustrating the process of determining a memory optimization strategy in a memory optimization method according to another embodiment of this disclosure.
[0027] Figure 10 This is a flowchart illustrating the process of determining a memory optimization strategy in a memory optimization method according to yet another embodiment of this disclosure.
[0028] Figure 11 This is a schematic structural block diagram of a memory optimization apparatus according to one embodiment of the present disclosure.
[0029] Figure 12 This is a schematic structural block diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation
[0030] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0031] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0032] In high-concurrency applications such as database systems or large-scale caching services, frequent data structure traversals can cause specific memory pages to become hot pages, leading to severe cache contention and remote memory access latency. Similarly, in cloud-native microservice architectures or real-time data analytics systems, multiple containers or threads share physical memory. A frequently accessed linked list or hash table can generate a large number of hot pages due to the continuous creation of objects by the allocation source. Traditional memory management mechanisms cannot identify which specific data structure or code path caused these hot pages, resulting in the adoption of globally uniform paging or prefetching strategies, which wastes bandwidth and fails to effectively alleviate local performance bottlenecks.
[0033] To address this, this disclosure proposes a memory optimization method. This method constructs a memory page access graph containing access order relationships to accurately identify hot memory pages. By combining the mapping relationship between memory pages and allocation sources, the source of the hot memory pages is traced—that is, candidate allocation sources that have performed memory allocation operations on the hot memory pages. Furthermore, joint analysis is performed using the behavioral characteristics of allocation sources and the local access subgraph of the hot pages to filter out the target allocation sources that truly cause the hotspots. Based on the target allocation sources, a fine-grained optimization strategy is generated, significantly reducing hotspot access latency, minimizing invalid I / O bandwidth consumption, improving cache hit rate and memory locality, effectively alleviating local performance bottlenecks in multi-tenant shared environments or real-time data processing scenarios, and enhancing the system's scalability and deterministic response.
[0034] To facilitate description and make the technical solutions of this disclosure easier to understand, the terminology of this disclosure will be explained before describing the technical solutions of this disclosure.
[0035] A memory page is the basic unit of memory management used by the operating system. It is used to divide physical memory into fixed-length blocks to support mechanisms such as virtual memory, paging, and address mapping. Each memory page can be allocated, swapped in, or swapped out independently, enabling programs to efficiently access and isolate large address spaces.
[0036] A memory page access graph is a directed graph used to describe memory access patterns during program runtime. Nodes represent memory pages, and edges represent access relationships from one memory page to another. The weights on the edges reflect access frequency or temporal locality, and are used to analyze locality and hotspot behavior in memory access.
[0037] Figure 1 This is a schematic diagram illustrating an application scenario of a memory optimization method according to one embodiment of this disclosure. For example... Figure 1 As shown, the system can include a client 100 and a server 200. The client can be a terminal device such as a computer, mobile phone, or tablet, or different programs or applications on the same terminal device, or different processes or applications on the server. There can be one or more clients. The server can include multiple storage nodes, which can be various storage units within the server, such as hard drives. The client can send data to the server, and the server can store the received data. The client can also request data from the server. In this way, data access can be achieved between the client and the server.
[0038] Figure 2 This is a schematic diagram of the overall flow of a memory optimization method according to one embodiment of the present disclosure. Figure 2 The method M200 shown includes steps S210 to S250. This method can be executed by a server process.
[0039] In step S210, memory pages in the memory page access graph are filtered based on memory access frequency to determine hot memory pages. The memory access graph includes the access order of memory pages.
[0040] By collecting and modeling memory access events generated during program execution, a memory page access graph is constructed, containing the access order and timing relationships between memory pages. Based on this, the access frequency of each memory page within a target time period is statistically analyzed, and memory pages with access frequencies significantly higher than the average level are selected as hot memory pages using a set hotspot threshold. This approach not only considers the popularity of individual pages but also preserves their dependencies within the access flow, providing a topological foundation for subsequent investigation into the causes of hotspots.
[0041] In step S220, based on the mapping relationship between memory pages and memory page allocation sources, a set of candidate allocation sources that have performed memory allocation operations on hot memory pages is determined.
[0042] Based on the mapping relationship between memory pages and memory page allocation sources, the system queries the memory page allocation source information corresponding to hot memory pages. All memory page allocation sources that have participated in hot page allocation are aggregated to form a candidate allocation source set. This provides an initial input set for subsequent screening of the target allocation source that truly triggers the hotspot.
[0043] Preferably, the memory page allocation source is the code execution location or system entity that, during program execution, directly or indirectly initiates a memory allocation request and ultimately leads to the allocation and use of physical memory pages. The memory page allocation source can be a function call point in a user-mode process (such as the line of code containing the malloc operator in C or the new operator in C++), or it can be a memory allocation interface in the kernel path (such as the call location of kmalloc, __get_free_page, etc.).
[0044] Specifically, in containerized or virtualized environments, the memory page allocation source can also be extended to thread ID, process group, namespace, or microservice instance to identify the subject of ownership of memory resources.
[0045] In step S230, based on the mapping relationship between memory page allocation sources and allocation source behavior characteristics, the allocation source behavior characteristics of candidate allocation sources in the candidate allocation source set are determined. The allocation source behavior characteristics include the historical memory allocation characteristics of memory page allocation sources.
[0046] Based on the mapping relationship between memory page allocation sources and their behavioral characteristics, the behavioral characteristics of each memory page allocation source in the candidate allocation source set are queried. Through this mapping process, the operational inertia and resource usage tendencies of each candidate allocation source are obtained, forming a behavioral input vector that can be used for subsequent filtering and strategy generation.
[0047] Preferably, the allocation source behavior characteristics include statistical information such as the average allocation size, allocation frequency, lifecycle distribution, release pattern, and / or access locality of the allocated memory pages over a period of time.
[0048] In step S240, based on the allocation source behavior characteristics and the access subgraph of hot memory pages, the candidate allocation sources in the candidate allocation source set are filtered to determine the target allocation source. The access subgraph is the topology of hot memory pages in the memory page access graph.
[0049] Based on the behavioral characteristics of candidate allocation sources and the access subgraphs of their associated hot memory pages, the semantic matching degree between them is calculated. Through similarity comparison or pattern recognition algorithms, candidate allocation sources with highly consistent behavioral characteristics and access patterns are selected and identified as target allocation sources. This ensures that subsequent optimization strategies apply to the memory page allocation sources that are truly causing performance bottlenecks.
[0050] In step S250, a memory optimization strategy is determined based on the allocation source behavior characteristics of the target allocation source and the access subgraph of hot memory pages to optimize the memory.
[0051] Based on the identified target allocation source and its corresponding behavioral characteristics and data structure types, a set of targeted memory optimization strategies is dynamically generated. These strategies include, but are not limited to: configuring a dedicated memory pool for the target allocation source to optimize the allocation path; triggering predictive prefetching based on its access patterns; implementing coordinated swapping in and out of its associated memory pages; or migrating related pages to the NUMA node where the accessing thread resides to improve locality. This achieves focused protection and precise intervention for high-impact allocation sources, effectively alleviating performance bottlenecks caused by hotspot access.
[0052] Preferably, based on the access subgraph of hot memory pages, the target allocation source and its corresponding allocation source behavior characteristics, a memory optimization strategy is determined through semantic matching and pattern recognition. The memory optimization strategy includes memory allocation, memory prefetching, memory swapping in and out and / or memory migration.
[0053] For example, the topology, edge weights, access order, and temporal features of the access subgraph based on hot memory pages are extracted to construct a memory access feature vector. Simultaneously, the target allocation source and its corresponding allocation source behavior features, including allocation frequency, size, and lifecycle, are obtained. The memory access feature vector is fused with the allocation source behavior features, and semantic matching is performed using a pre-defined rule base or machine learning model to identify the data structure type operated on by the allocation source. Further, pattern recognition is performed by combining the dynamic behavior patterns of the access subgraph to determine whether the current access pattern belongs to sequential traversal, random search, high-concurrency contention, or periodic access scenarios. Based on the identified data structure type and access pattern, the optimal combination of memory optimization strategies is generated through table lookup or reasoning. For example, a dedicated memory pool and sequential prefetching are enabled for linked list structures; parent-child page collaborative prefetching and page locking are implemented for B+ tree index paths; a lock-free memory pool is configured for high-concurrency hash buckets and transparent giant pages are disabled; or large page mapping and vectorized prefetching are enabled for array access. Based on this, corresponding memory allocation, prefetching, swapping in / out, or cross-NUMA migration operations are performed to achieve fine-grained and adaptive memory management oriented towards application semantics.
[0054] In summary, based on the access frequency and access order relationships recorded in the memory page access graph, frequently and structurally accessed hot memory pages are identified. Then, combining the mapping relationship between memory pages and allocation sources, a set of candidate allocation sources is determined. Semantic matching analysis is performed between the behavioral characteristics of candidate allocation sources and the access subgraph of hot memory pages to filter out the target allocation source most likely to trigger hot behavior. Based on this target allocation source, a fine-grained, customized memory optimization strategy is generated. This overcomes the limitations of traditional operating systems that rely solely on page popularity as a single criterion, achieving accurate attribution of hotspot causes and differentiated resource scheduling based on program semantics. It effectively alleviates cache contention, reduces tail latency, and improves throughput in typical loads such as database index scanning, cache service hash lookups, or real-time data analysis.
[0055] Regarding step S210, before filtering memory pages in the memory page access graph based on memory access frequency to determine hot memory pages, in some embodiments of this disclosure, it may include, as follows: Figure 3 Steps S310 to S320 are shown.
[0056] In step S310, in response to a memory operation request, feature extraction is performed on the memory operation request based on a time window to determine the memory operation features.
[0057] When a memory operation request is detected, memory access events occurring within a sliding or fixed time window are collected and aggregated. Multidimensional features, including access frequency, access sequence, address distribution, and / or time intervals, are extracted to form structured memory operation features. These features reflect the patterns of memory access behavior within a local time frame, serving as the foundational input for constructing a memory page access graph and identifying hotspots.
[0058] Optionally, memory operation requests may include page accesses or page faults.
[0059] In step S320, a memory page access graph is constructed or updated based on memory operation characteristics.
[0060] Based on the extracted memory operation features, a weighted directed graph is constructed as a memory page access graph. Nodes represent physical memory pages, edges represent the order of access between pages, and edge weights reflect transition frequency or confidence levels. When new memory operation features are introduced, the node attributes and connections of this memory page access graph are dynamically updated to reflect real-time changes in program memory access patterns. This memory page access graph not only records which memory pages are frequently accessed but also preserves their access order and contextual dependencies, providing a basis for subsequent identification of hot pages and their topology.
[0061] By responding to memory operation requests and extracting features from memory access behavior based on time windows, discrete or low-level memory access events can be transformed into structured memory operation features containing multi-dimensional information such as access frequency, access sequence, time interval, and address distribution. This effectively captures the memory access patterns and contextual dependencies of a program within a local time frame. Based on this, a memory access graph between memory pages is dynamically constructed or updated using these features. Nodes represent memory pages, and edges represent the access order and transfer intensity between pages, thereby achieving topological and semantic modeling of program data access behavior. This approach overcomes the limitations of traditional memory management, which only focuses on single-page popularity. It not only identifies frequently accessed hot pages but also preserves their access paths, transfer patterns, and temporal relationships. This provides high-fidelity contextual evidence for subsequent accurate identification of hotspot subgraphs, tracing allocation sources, predicting access trends, and formulating optimization strategies oriented towards data structure semantics, significantly improving the accuracy of hotspot judgment and the foresight of memory optimization.
[0062] In step S210, in some embodiments of this disclosure, it may include, for example... Figure 4 Steps S2101 to S2102 are shown.
[0063] In step S2101, the edge weights of memory pages in the memory page access graph are traversed to determine the memory access frequency of memory pages within the target time period.
[0064] Based on the constructed or updated memory page access graph, the weights of all directed edges in the graph that start or end with a memory page are traversed and aggregated, where the edge weights reflect the frequency of access transitions between pages. By summing the weights of the incoming and / or outgoing edges related to the memory page, and combining this with timestamp information to limit the time period, the memory access frequency of the memory page within that time period is calculated.
[0065] In step S2102, based on memory access frequency, memory pages in the memory page access graph are filtered to determine hot memory pages whose memory access frequency is greater than the hotspot threshold.
[0066] After obtaining the access frequency of each memory page within the target time period, it is compared with a preset hotspot threshold. If the access frequency of a memory page exceeds the hotspot threshold, it is determined to be a hotspot memory page and included in the subsequent key analysis and optimization scope. The hotspot threshold can be dynamically adjusted according to the system load to adapt to performance characteristics changes under different application scenarios. This filtering process achieves efficient pruning of massive memory pages, focusing on the core pages that truly affect performance, reducing subsequent processing overhead and improving optimization accuracy.
[0067] By traversing the edge weights of each memory page in the memory page access graph, the frequency of incoming and / or outgoing edge access transitions within a target time period can be aggregated, accurately quantifying the actual access frequency of each memory page and effectively capturing global heat features under multi-path or concurrent access. Based on this, the access frequency is compared with a preset hotspot threshold, and memory pages with access frequencies significantly higher than normal levels are selected as hotspot memory pages. This method overcomes the limitations of traditional methods that rely solely on page fault counts or simple counters, fully utilizing the topological relationships and weight information in the access graph to achieve context-aware, dynamic, and precise identification of hotspot memory pages. It can not only discover isolated, frequently accessed pages but also identify hidden hotspots formed by structured access patterns.
[0068] Regarding step S220, before determining the set of candidate allocation sources that have performed memory allocation operations on hot memory pages based on memory access frequency and the mapping relationship between memory pages and memory page allocation sources, in some embodiments of this disclosure, it may include, as follows: Figure 5 Steps S2201 to S2202 are shown.
[0069] In step S2201, in response to the memory allocation request, the metadata of the allocated memory page is determined. The metadata includes the allocation source, the unique identifier of the metadata, the allocation time, the allocation size, and / or the unique identifier of the memory page.
[0070] In response to memory allocation requests, the system captures relevant attribute information of the memory pages generated by the allocation in real time, forming structured metadata. This metadata is used to establish a mapping relationship between memory pages and allocation sources, and supports advanced optimization functions such as hotspot attribution and behavioral feature statistics.
[0071] In step S2202, the mapping relationship between memory pages and memory page allocation sources is determined based on metadata.
[0072] Based on the metadata collected during memory allocation, a structured mapping table is constructed, using the allocated memory page as the key and the corresponding memory page allocation source as the value, forming a mapping relationship between memory pages and memory page allocation sources. This mapping relationship records which memory page allocation source created each memory page, providing crucial information for subsequently identifying the responsible party for hot pages, analyzing their historical behavior characteristics, and formulating targeted optimization strategies.
[0073] By responding to memory allocation requests and collecting metadata of allocated memory pages in real time, a precise mapping relationship between memory pages and allocation sources is constructed. This establishes a causal link between physical memory resources and their logical creators, enabling the ability to trace back from hot memory phenomena to the specific memory page allocation source, overcoming the limitations of traditional memory management that lacks context awareness. Therefore, it not only accurately identifies the responsible party for frequently allocating hot memory pages but also provides a reliable data foundation for subsequent behavioral characteristic analysis based on allocation sources, access pattern attribution, and customized optimization strategies, significantly improving the refinement and intelligence of memory management.
[0074] Regarding step S240, in some embodiments of this disclosure, it may include, for example... Figure 6 Steps S2401 to S2403 are shown.
[0075] In step S2401, feature extraction is performed on the access subgraph of hot memory pages to determine the memory access feature vector.
[0076] For hot memory pages, their neighborhood subgraph (i.e., access subgraph) in the memory page access graph is extracted, including the incoming and outgoing edges directly connected to them and their adjacent nodes. Based on the topology and edge weight information of this access subgraph, a set of multi-dimensional statistical features, such as node degree, path length, clustering coefficient, and / or access frequency distribution, are calculated and organized into a structured memory access feature vector. The memory access feature vector is used to characterize the memory access context of the hot memory page, reflecting the types of data structures and access patterns it may participate in, supporting subsequent joint analysis with allocation source behavior features.
[0077] In step S2402, similarity calculation is performed on the allocation source behavior features and memory access feature vectors to determine the similarity of candidate allocation sources in the candidate allocation source set.
[0078] Based on the allocation source behavior characteristics of candidate allocation sources and the memory access feature vectors extracted from the access subgraphs of hot memory pages, a similarity score is calculated between the two in a unified feature space. This similarity score measures whether the behavior pattern of the candidate allocation source is consistent with the current hot access behavior, thereby assessing the likelihood that it is the true cause of the hotspot. Memory page allocation sources with high similarity are preferentially retained as the basis for subsequent selection of target allocation sources.
[0079] In step S2403, the candidate allocation sources in the candidate allocation source set are filtered based on the similarity of the candidate allocation sources in the candidate allocation source set to determine the target allocation source.
[0080] Based on the similarity of candidate allocation sources in the candidate allocation source set, the candidate allocation sources are screened, including setting a similarity threshold, retaining the highest-scoring item, or combining multi-dimensional weights for comprehensive evaluation, thereby selecting the target allocation source most likely to cause the hot topic behavior. This target allocation source is regarded as the responsible party for the current hot topic phenomenon, providing a clear operational object for subsequent fine-grained optimization strategies.
[0081] This method achieves accurate attribution from memory access phenomena to target allocation sources. Compared to traditional methods that rely solely on static call relationships or simple counting and matching, it effectively identifies the true responsible function most likely to cause hotspots by quantifying the semantic consistency between access patterns and allocation behavior, significantly improving attribution accuracy. It can not only distinguish between functionally similar but semantically different allocation paths, but also automatically focus on high-confidence targets in multi-candidate scenarios, providing a reliable basis for subsequent implementation of targeted optimization strategies.
[0082] Regarding step S250, in some embodiments of this disclosure, it may include, for example... Figure 7 Steps S2501 to S2503 are shown.
[0083] In step S2501, the target memory page corresponding to the target allocation source is determined based on the mapping relationship between memory pages and memory page allocation sources.
[0084] Based on the mapping relationship between memory pages and memory page allocation sources, a reverse lookup is performed to find the target memory page allocated by the target allocation source. The target memory page is considered a core resource directly affected by the target allocation source and serves as the object of subsequent optimization strategies, ensuring that optimization measures are accurately applied to truly relevant data entities.
[0085] In step S2502, the target memory page is stored in the target memory pool, which is used to store the physical memory space of the memory page of the target allocation source.
[0086] After identifying the target memory pages managed by the target allocation source, they are migrated or pre-allocated to a dedicated target memory pool, which is logically assigned to the exclusive use of that allocation source. This achieves centralized management of hot resources in physical space, enhances data locality, and provides a foundation for subsequent efficient memory allocation and access optimization for that allocation source.
[0087] In step S2503, in response to the memory allocation request from the target allocation source, memory pages are determined from the target memory pool for memory allocation.
[0088] In response to a memory allocation request from a target allocation source, the system prioritizes searching for available memory pages in its associated target memory pool and completes the allocation operation. If there are free pages in the target memory pool, the system returns directly, avoiding cross-region access; if the target memory pool lacks resources, it may trigger expansion or a fallback to the general allocator. This mechanism ensures that memory requested by hotspot-causing functions is preferentially allocated to high-performance, low-latency dedicated regions, thereby significantly improving subsequent access efficiency and overall system responsiveness.
[0089] By determining the target memory page corresponding to the target allocation source based on the mapping relationship between memory pages and allocation sources, and migrating or pre-loading it into a dedicated target memory pool, subsequent memory allocation requests from this target allocation source are preferentially allocated from this target memory pool, thus implementing a resource-dedicated mechanism for high-impact code paths. Compared with traditional unified memory management methods, this significantly improves the locality and predictability of hot data access. On the one hand, it provides a dedicated low-latency memory supply channel for the target allocation source, reducing cross-NUMA node access and cache jitter. On the other hand, by centrally managing frequently interacting pages, it enhances the cache hit rate while avoiding resource interference with non-critical paths, achieving fine-grained and semantically aware memory resource scheduling.
[0090] Regarding step S250, in some other embodiments of this disclosure, it may include, for example... Figure 8 Steps S810 to S820 are shown.
[0091] In step S810, the data structure type of the target allocation source is determined based on the target allocation source and the corresponding allocation source behavior characteristics.
[0092] Based on the target allocation source and its corresponding behavioral characteristics, and combined with a pre-defined behavioral pattern library or machine learning model, the data structure types that the target allocation source may operate on are classified and determined. This determination is used to guide the selection and generation of subsequent customized optimization strategies, making resource management more closely aligned with practical application semantics.
[0093] Preferably, the data structure type includes linked list nodes, tree structure pages, hash buckets, or array elements.
[0094] In step S820, a memory optimization strategy is determined based on the data structure type and access subgraph of the target allocation source.
[0095] Based on the data structure type and access subgraph of the target allocation source, and according to optimization strategy mapping rules or machine learning models, the most suitable memory optimization strategy for the current scenario is selected. This memory optimization strategy may include dedicated memory pool allocation, prefetch mode setting, page migration, NUMA binding, and / or big page mapping, ensuring a high degree of coordination between resource scheduling and application access patterns to maximize performance gains.
[0096] By combining the target allocation source and its behavioral characteristics, along with the access subgraph structure of the hot memory pages associated with the target allocation source, the type of data structure it operates on can be collaboratively inferred. Furthermore, based on the semantic features of this data structure type and access pattern, the optimal memory optimization strategy is intelligently matched and determined. This overcomes the limitations of traditional static or general optimization methods, achieving refined memory management based on structure-specific strategies.
[0097] Regarding step S820, in some embodiments of this disclosure, it may include, for example... Figure 9 Steps S8201 to S8202 are shown.
[0098] In step S8201, based on the data structure type of the target allocation source and the access subgraph, the first memory page and the second memory page with edge weights greater than the weight threshold in the access subgraph are determined, and the first memory page points to the second memory page based on the access order.
[0099] Based on the data structure type and access subgraph of the target allocation source, the access frequency or time-related weights of each edge in the access subgraph are analyzed. Directed edges with weights greater than a weight threshold are selected. Each qualifying edge represents a high-frequency and stable page transfer behavior. The starting point of each edge is the first memory page, and the ending point is the second memory page, indicating that the second memory page is tended to be accessed immediately after the first memory page is accessed. These high-weight memory page pairs are identified as core access sequences to guide the design and execution of subsequent targeted optimization strategies.
[0100] In step S8202, in response to a memory swap-in request for the first memory page, an asynchronous prefetch is performed on the second memory page, and the second memory page is loaded into the prefetch buffer.
[0101] In response to a memory swap-in request, it determines whether the memory page in the request is the starting point of a high-weight access path, and accordingly triggers an asynchronous prefetch operation on the second memory page directly associated with it. This prefetch process is independent of the current execution flow, completing page loading and storing in the prefetch buffer in the background. This ensures that when the program subsequently accesses the second memory page, it can be directly hit, avoiding additional I / O or remote access overhead, thereby improving overall access efficiency.
[0102] By combining the data structure type of the target allocation source with the memory access subgraph, high-confidence access transfer paths with edge weights greater than the weight threshold are identified, indicating that the first memory page points to the second memory page in the access order. Upon responding to the first memory page swap-in request, an asynchronous prefetch of the second memory page is proactively initiated and loaded into the prefetch buffer. This achieves a semantically aware and precise prefetching mechanism. Compared to traditional prefetching strategies based on fixed step size or simple locality, this scheme can accurately capture complex but high-frequency program behavior patterns such as linked list traversal, tree structure drill-down, or hash collision chain access, triggering prefetching only when strong transfer relationships exist, significantly improving prefetch hit rate and reducing invalid I / O overhead. Simultaneously, filtering using data structure semantics avoids misjudging accidental or noisy accesses as optimization targets, making the prefetching behavior more context-aware.
[0103] Regarding step S250, determining the memory optimization strategy, in some embodiments of this disclosure, it may include, as follows: Figure 10 Steps S1010 to S1030 are shown.
[0104] In step S1010, the confidence level of accessing memory pages in the access subgraph is determined based on the edge weights, access order, and / or access time of the memory pages in the access subgraph.
[0105] Based on the memory page access subgraph, a confidence score is calculated for each memory page or each transition path, taking into account dynamic characteristics such as the access frequency (i.e., edge weight), the access order between memory pages, and the time interval between accesses of adjacent memory pages. This confidence score reflects the stability and predictability of the memory page in the current access pattern, and is used to filter out truly high-frequency and continuous hotspot behaviors, avoiding misjudging accidental, noise, or short-term fluctuations as optimization targets, thereby improving the effectiveness of subsequent prefetching, migration, and other strategies.
[0106] In step S1020, based on the confidence level, the memory pages in the access subgraph are filtered to determine the target memory page group with a confidence level greater than the confidence level threshold.
[0107] After calculating the confidence level of each memory page in the access subgraph, a dynamically adjusted confidence threshold is set. Memory pages with confidence levels higher than this threshold are filtered out to form a target memory page group. This target memory page group represents the most stable, predictable, and valuable hot data set in the current workload. It can be used to guide subsequent fine-grained management strategies such as memory swapping, prefetching, locking, or dedicated pool allocation, avoiding ineffective intervention on low-value or noisy pages.
[0108] In step S1030, in response to a memory swap-out request, the target memory page group is swapped out.
[0109] When a memory swapping process is triggered (e.g., due to memory pressure requiring the reclamation of memory pages), memory pages that have been assessed as having low confidence and do not constitute a stable access pattern are prioritized for swapping out. These memory pages belong to the target memory page group selected in the early stages, and their access behavior is accidental, unpredictable, or transient, with a low probability of being accessed again in the future. By prioritizing the swapping out of the target memory page group, the impact on core workload performance is minimized while releasing memory.
[0110] It enables a refined distinction between memory hotness and access value. Compared with traditional swapping strategies based solely on access frequency or LRU mechanism, it can effectively distinguish between occasional high-frequency access and structurally stable access, avoids mistakenly swapping out pages with high context relevance and high probability of future access, and prioritizes releasing pages with low confidence or non-critical paths, thereby improving the effectiveness and locality of memory-resident data.
[0111] The technical solution of the present invention will be further illustrated below using a specific application scenario of remote memory data exchange as an example. Those skilled in the art should understand that the invention can be applied to other scenarios besides those described below.
[0112] First, a page-level transfer method is used by default. By modifying the operating system's memory management module, an efficient and reliable data path is provided for data exchange between local physical memory and remote memory. Low-latency transfer is achieved through RDMA technology, and a control interface is exposed to upper layers (such as user-mode analysis daemons). This control interface enables it to respond to higher-level compound instructions, such as atomically swapping out a group of memory pages or asynchronously prefetching a list of memory pages, rather than simply handling the swapping in and out of single pages.
[0113] Furthermore, mechanisms like LD_PRELOAD are used to load at application startup, enabling hooking to standard memory allocation functions (such as malloc). It is responsible for capturing and recording detailed allocation metadata, and for receiving and executing layout optimization strategies issued by the daemon for specific allocation behaviors. It records which CPU instruction triggered the page fault. If the same instruction triggers faults on different memory pages, it indicates that these memory pages may store objects of the same type. Each memory page is divided into a node. If memory page B is accessed shortly after memory page A, a directed edge is created between memory pages A and B, forming a memory page access graph. In the memory page access graph, if a dense, linear, and unidirectional strong weighted chain appears, these memory pages are very likely to form a large array and a huge structure, or a file mapping that is sequentially scanned. These memory pages can then be defined as a memory page group. When memory swapping is needed, they are swapped out to a contiguous region of remote memory.
[0114] Specifically, the memory allocation monitoring module is loaded when the application starts. Whenever the application calls the malloc function, the memory allocation monitoring module first captures its code call stack through stack backtracking and other methods to generate an allocation source identifier, then calls the underlying allocator to obtain a memory block, and finally sends metadata records containing the allocation source identifier, allocation size, timestamp, and memory page ID to the analysis daemon and builds an allocation source database.
[0115] Once the analysis daemon starts, it dynamically and securely attaches multiple probes to critical kernel functions using eBPF technology, such as `do_page_fault` (used to capture page faults), scheduler-related functions, and other memory management-related kernel functions. These probes capture events with extremely low overhead and send formatted data to the daemon's user-space.
[0116] The analysis daemon's correlation analysis unit consumes event streams from the kernel. When the analysis daemon receives a sequence, such as "memory page P_A was accessed at time t1, and memory page P_B was accessed at time t2 without context switching," the analysis daemon creates or updates the edge pointing from P_A to P_B in the page access graph (PAG), and calculates and updates the edge weight vector (edge weight) based on information from the time interval t2 to t1. The analysis daemon periodically, or when the system load reaches a threshold, analyzes the page access graph, identifying hot memory pages in the current memory page working set through metrics such as the access frequency and weighted degree of nodes (i.e., memory pages).
[0117] For an identified hot memory page P_hot, the allocation source metadata is queried to find all memory allocation sources that have previously allocated memory on the hot memory page, forming a candidate allocation source set {AS_1, AS_2, ...}. An access subgraph centered on the hot memory page is extracted from the memory page access graph, and its current topological characteristics are analyzed. For example, a portion of a linear chain of length N can be used as the access subgraph. For each candidate allocation source in the candidate allocation source set, its pre-stored allocation source behavior profile, i.e., behavioral features, is queried. Using a similarity matching function, the candidate allocation source with the highest similarity score is selected as the target allocation source; that is, the target allocation source is inferred to be the root cause of the hot memory page becoming hot.
[0118] Based on the root causes of hot memory pages identified in the analysis phase, a set of specific and executable optimization instructions—i.e., memory optimization strategies—is generated. For example, if the analysis reveals a strongly connected subgraph (i.e., a high-confidence logical whole) consisting of at least two or more memory pages in the memory page access graph, the generated optimization instruction defines these memory pages as a memory page group. When system memory pressure is high and this memory page group contains cold data, the instruction kernel module atomically swaps out this memory page group.
[0119] If the analysis reveals a high-weight edge in the memory page access graph, from the first memory page to the second memory page, and this is attributed to a memory page allocation source with a certain chain structure, then the optimized instruction generated is to asynchronously prefetch the second memory page with high priority when the first memory page is swapped in.
[0120] If the hotspot attribution algorithm determines that the target allocation source is the hotspot, it generates an optimization instruction to raise the allocation isolation level of the target allocation source to the alert level. The analysis daemon sends target page group definition, migration, and prefetch instructions to the kernel swap module via the ioctl interface. The analysis daemon also sends the allocation isolation policy to the memory allocation monitoring and optimization module via the IPC channel. Upon receiving the instruction, the memory allocation monitoring and optimization module modifies its internal memory allocation logic to ensure that the next malloc request from the target allocation source is allocated to the dedicated target memory pool.
[0121] Based on any of the above embodiments, this disclosure also provides a memory optimization apparatus.
[0122] Figure 11 This is a schematic block diagram of a memory optimization apparatus according to one embodiment of the present disclosure.
[0123] like Figure 11 As shown, the memory optimization device includes:
[0124] The hot memory page acquisition module 1102 filters the memory pages in the memory page access graph to determine the hot memory pages;
[0125] The candidate allocation source set determination module 1104 determines the set of candidate allocation sources that have performed memory allocation operations on hot memory pages based on the mapping relationship between memory pages and memory page allocation sources.
[0126] The allocation source behavior feature determination module 1106 determines the allocation source behavior features of candidate allocation sources in the candidate allocation source set based on the mapping relationship between memory page allocation sources and allocation source behavior features.
[0127] The target allocation source determination module 1108 filters the candidate allocation sources in the candidate allocation source set based on the allocation source behavior characteristics and the access subgraph of hot memory pages to determine the target allocation source;
[0128] The memory optimization module 1110 determines the memory optimization strategy based on the target allocation source.
[0129] The aforementioned memory optimization device can be in the form of computer software, and each module of the aforementioned memory optimization device can be implemented through computer software modules.
[0130] The specific implementation process of the functions and roles of each module in the above memory optimization device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0131] This disclosure also provides an electronic device 1000. Figure 12 A schematic diagram of the hardware implementation using the processing system is shown.
[0132] The hardware structure of electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc. Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this figure, but this does not indicate that there is only one bus or one type of bus.
[0133] For ease of explanation, certain steps of the above method are described in relation to modules. It should be understood that the corresponding module performing one or more steps of the above method may be one or more hardware modules specifically configured to perform the corresponding step, or implemented by a processor configured to perform the corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination thereof.
[0134] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.
[0135] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.
[0136] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any available medium capable of access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or it can include both volatile and non-volatile types of storage media.
[0137] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0138] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0139] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0140] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0141] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment / mode or example, which are included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.
[0142] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0143] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A memory optimization method, characterized in that, include: Based on memory access frequency, memory pages in the memory page access graph are filtered to identify hot memory pages. The memory page access graph includes the access order of memory pages. Based on the mapping relationship between memory pages and memory page allocation sources, a set of candidate allocation sources that have performed memory allocation operations on the hot memory pages is determined; the memory page allocation sources are function call points in user-mode processes, memory allocation interfaces in kernel paths, thread IDs, process groups, namespaces, or microservice instances. Based on the mapping relationship between memory page allocation sources and allocation source behavior characteristics, the allocation source behavior characteristics of candidate allocation sources in the candidate allocation source set are determined, and the allocation source behavior characteristics include the historical memory allocation characteristics of the memory page allocation sources; Based on the allocation source behavior characteristics and the access subgraph of the hot memory page, the candidate allocation sources in the candidate allocation source set are filtered to determine the target allocation source. The access subgraph is the topological structure of the hot memory page in the memory page access graph. as well as Based on the allocation source behavior characteristics of the target allocation source and the access subgraph of the hot memory pages, a memory optimization strategy is determined for memory optimization, including: Based on the target allocation source and the corresponding allocation source behavior characteristics, the data structure type of the target allocation source is determined; Based on the data structure type of the target allocation source and the access subgraph, a memory optimization strategy is determined; The memory optimization strategy is determined based on the data structure type of the target allocation source and the access subgraph, including: Based on the data structure type of the target allocation source and the access subgraph, the first memory page and the second memory page with edge weights greater than the weight threshold in the access subgraph are determined. The first memory page points to the second memory page based on the access order. That is, based on the data structure type of the target allocation source and the access subgraph, the access frequency or time correlation weight of each edge in the access subgraph is analyzed, and directed edges with edge weights greater than the weight threshold are selected. Each edge that meets the conditions represents a high-frequency and stable page transfer behavior. The starting point of the edge is the first memory page, and the ending point is the second memory page. In response to a memory swap-in request for the first memory page, the second memory page is asynchronously prefetched and loaded into the prefetch buffer; Based on the data structure type of the target allocation source and the access subgraph, the memory optimization strategy is determined, further including: The confidence level of the memory pages in the access subgraph is determined based on the edge weights, access order, and / or access time of the memory pages in the access subgraph. Based on the confidence level, the memory pages in the access subgraph are filtered to determine the target memory page group with a confidence level greater than the confidence threshold; In response to a memory swap-out request, the target memory page group is swapped out; Specifically, based on the allocation source behavior characteristics and the access subgraph of the hot memory pages, the candidate allocation sources in the candidate allocation source set are filtered to determine the target allocation source, including: Feature extraction is performed on the access subgraph of the hot memory pages to determine the memory access feature vector; The similarity between the allocation source behavior features and the memory access feature vector is calculated to determine the similarity between the candidate allocation sources in the candidate allocation source set. Based on the similarity of the candidate allocation sources in the candidate allocation source set, the candidate allocation sources in the candidate allocation source set are filtered to determine the target allocation source.
2. The memory optimization method as described in claim 1, characterized in that, Based on memory access frequency, memory pages in the memory page access graph are filtered to identify hot memory pages, including: By traversing the edge weights of memory pages in the memory page access graph, the memory access frequency of the memory page within the target time period is determined. Based on the memory access frequency, memory pages in the memory page access graph are filtered to identify hot memory pages whose memory access frequency is greater than the hotspot threshold.
3. The memory optimization method as described in claim 1, characterized in that, Based on memory access frequency, the memory pages in the memory page access graph are filtered to identify hot memory pages, including: In response to a memory operation request, feature extraction is performed on the memory operation request based on a time window to determine the memory operation features; Based on the memory operation characteristics, construct or update the memory page access graph.
4. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes execution instructions stored in the memory, causing the processor to perform the memory optimization method according to any one of claims 1 to 3.
5. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the memory optimization method according to any one of claims 1 to 3.