A hotspot-based memory access method and program product

By collecting and analyzing the memory mapping relationships of processes, a memory locking strategy is formulated to precisely lock only hot memory, which solves the problems of large memory consumption and low utilization, and achieves efficient utilization of memory resources and performance improvement.

CN122240536APending Publication Date: 2026-06-19CHONGQING SARUIYU SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING SARUIYU SOFTWARE CO LTD
Filing Date
2026-03-19
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing memory-resident solutions suffer from coarse granularity, resulting in high memory consumption and low effective utilization, which increases equipment costs and maintenance difficulty.

Method used

By collecting data on the virtual memory mapping of the target process and the mapping relationship between physical memory pages, a report is generated describing the virtual memory pages that need to be locked. A memory locking strategy is then formulated, and hot memory is precisely locked only. When the process starts, the configuration file is read to load the hot memory into the physical memory.

Benefits of technology

It achieves improved memory resource utilization, reduced resident physical memory usage, enhanced performance of key application scenarios of software systems, and reduced computing and file I/O load without increasing hardware equipment and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240536A_ABST
    Figure CN122240536A_ABST
Patent Text Reader

Abstract

This invention discloses a memory access method and program product based on hotspots. The method includes collecting the virtual memory mapping information of a target process and the mapping relationship between virtual memory pages and physical memory pages of the target process; using a written script program to parse the collected virtual memory mapping information and the mapping relationship between virtual memory pages and physical memory pages, generating a report describing the virtual memory pages that need to be locked; formulating a memory locking strategy, constructing a data structure based on the memory locking strategy, and configuring memory segment / memory page locking information using a file in a specific format; reading the configuration file at the beginning of process startup, and loading and resident the hotspot memory in physical memory; when the user needs to access relevant file resources, directly accessing the data already loaded in memory. This invention, by collecting and loading hotspot memory in key application scenarios and resident it in physical memory, improves the performance of key application processes in the software system while minimizing the resident physical memory usage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of memory access technology, and specifically to a hotspot-based memory access method and program product. Background Technology

[0002] For service-type processes, performance optimization is achieved by preloading the resources required by the service when the process starts. A common approach is to use mmap (Memory Mapping) to load the service's resources into memory and then use mlock to keep the memory persistent. Another method is to add specific hardware resources to allow specific programs and the system to exclusively access memory resources to optimize program and system computational performance.

[0003] However, these common memory-resident solutions often suffer from coarse granularity and a lack of fine-grained memory management, resulting in high memory consumption and low effective memory utilization. In other words, these solutions not only generate excessive resident memory usage but also cause unnecessary performance waste during process startup. Adding hardware resources, on the other hand, increases equipment costs and the difficulty of program and system maintenance. Summary of the Invention

[0004] The purpose of this invention is to provide a memory access method and program product based on hotspots to solve the problems mentioned in the background art.

[0005] The specific technical solution provided by this invention is as follows: A memory access method based on hotspots, comprising the following steps:

[0006] Step 1: Collect the virtual memory mapping information of the target process, as well as the mapping relationship between the target process's virtual memory pages and physical memory pages.

[0007] Preferably, the virtual memory mapping of the target process is collected: the address space layout and memory usage details of the process are displayed; The process of collecting the mapping relationship between virtual memory pages and physical memory pages of the target process includes: displaying the physical page frames corresponding to the virtual memory pages of the process. Each virtual memory page corresponds to an entry containing information such as whether it exists in physical memory, the physical page frame number, whether it has been modified, whether it has been swapped to disk, whether it is locked, and the status information of the memory page permissions.

[0008] Step 2: Use the written script to parse the collected virtual memory mapping information and the mapping relationship between virtual memory pages and physical memory pages, and generate a report describing the virtual memory pages that need to be locked.

[0009] Preferably, the following two key pieces of information are extracted from the collected virtual memory mapping information of the target process, and the mapping relationship between the target process's virtual memory pages and physical memory pages: The mapping targets of each virtual memory page in the target process; Does the physical memory frame corresponding to each virtual memory page exist in physical memory? The two key pieces of information are correlated to generate and output a report. The report includes the starting address of the memory region, the total size of the memory region, the actual physical memory size occupied, the mapped file or description, the dirty page size, and permission information. The description includes a description of the virtual memory pages that need to be locked in the process.

[0010] Preferably, the process of parsing the collected virtual memory mapping information using the written script program includes: traversing the output report; retrieving and recording the actual physical memory size data after the predefined critical process; using the actual physical memory size data and the file or description information that has an incremental mapping before the defined critical process as data entries for the shared library file; the data entries are the data to be processed, and when there is an incremental physical memory size, it is determined that the shared library file is active in the target process, and memory access and page faults have occurred.

[0011] Preferably, the process of parsing the virtual memory page to physical memory page mapping relationship using the written script program includes: traversing the output report; calculating the virtual memory page number range corresponding to each data entry to be processed based on the starting address of the memory region and the total size of the memory region in the report, and obtaining the virtual memory page number; locating the corresponding physical memory page frame in the virtual memory mapping based on the virtual memory page number, determining whether the physical memory page frame exists in physical memory, and outputting the result of whether it exists or not.

[0012] Step 3: Develop a memory locking strategy, construct a data structure based on the memory locking strategy, and configure memory segment / page locking information using a file with a specific format.

[0013] Preferably, the established memory locking strategy includes: a. Hot memory is latched only when both "hot memory pages" and "non-hot memory pages" are large contiguous blocks of memory, and the proportion of "non-hot memory pages" in the memory segment exceeds a set threshold or the absolute size exceeds a set threshold. Otherwise, the entire memory segment is latched. b. Hotspot latching is only performed on shared library files for which the expected optimization amount exceeds a set threshold; c. Set a minimum number of memory pages to lock for a consecutive n pages.

[0014] Preferably, in the data structure: File path: Describes the path to the shared library file or executable file of the memory to be locked; Memory locking strategy: The memory locking strategy is described separately for each segment of the file, including three strategies: no memory locking, full segment memory locking, and segmented memory locking. When the segmented memory locking strategy is adopted, the continuous memory from the start page index of the memory locking segment to the end page index of the memory locking segment in the corresponding segment will be locked. Locked memory segment start page index: The start page number of the contiguous memory pages corresponding to each segment when the memory is locked in segments of the description file; it only takes effect when the segment-locked memory strategy is used in each segment; Locked memory segment termination page index: The termination page number of the contiguous memory pages corresponding to each segment when the memory is locked in segments of the description file; it only takes effect when the segment-locked memory strategy is used.

[0015] Step 4: At the beginning of process startup, read the configuration file and load hot memory into physical memory.

[0016] Preferably, for executable and linkable files: after the implicit or explicit loading is completed, the system interface is used to dynamically traverse the process's shared object list to obtain the starting address information of each segment of the shared object; the address and length of the memory region to be locked are calculated according to the memory locking policy configured in the configuration file and the starting page index and ending page index of the locked memory segment; and physical memory resident status is achieved through the interface. For ordinary non-executable linkable files, and executable files that require the entire file to lock memory: virtual memory mapping and physical memory resident are accomplished through the interface.

[0017] Step 5: When a user needs to access relevant file resources, they can directly access the data already loaded in memory.

[0018] On the other hand, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a hotspot-based memory access method.

[0019] Compared with the prior art, the beneficial effects achieved by the present invention are: (1) This invention collects hot memory in key application scenarios of software systems and improves the performance of key application scenarios of software systems by preloading and resident in physical memory. Compared with the conventional solution of mapping the entire file and resident in physical memory, this invention occupies less resident physical memory and has a higher memory resource utilization rate.

[0020] (2) Without increasing hardware equipment or manufacturing costs, this invention accurately collects hot memory in key application scenarios and loads and keeps it in physical memory, thereby improving the performance of key application processes in the software system while minimizing the occupation of resident physical memory, reducing computational load and file I / O load, and reducing the execution time of the solution, thus improving the overall performance of the software system. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the steps of the hotspot-based memory access method provided in an embodiment of the present invention. Figure 2 This is a flowchart illustrating the process of a software system accessing shared library resources without optimization, as provided in this embodiment of the invention. Figure 3 This is a flowchart illustrating the process of a software system accessing shared library resources under the conventional optimization scheme provided in this embodiment of the invention. Figure 4 This is a schematic diagram of the process when a software system accesses shared library resources under the technical solution of the present invention, as provided in an embodiment of the present invention. Detailed Implementation

[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.

[0023] Example 1: In this embodiment, as Figure 1 As shown, this embodiment describes a hotspot-based memory access method, which comprises two parts: hotspot memory acquisition and loading (mmap) and resident physical memory (mlock) in the target critical application scenario. The specific implementation steps include: Step 1: Collect the virtual memory mapping information of the target process, as well as the mapping relationship between the target process's virtual memory pages and physical memory pages.

[0024] In this embodiment, without any optimization, the present invention collects the virtual memory mapping of the target process and the mapping relationship between virtual memory pages and physical memory pages (e.g., using the pagemap tool) for the target application scenario. The virtual memory mapping of the target process is collected before and after critical processes, again using tools such as pmap. The pmap tool can collect the process's virtual memory mapping, displaying the process's address space layout and memory usage details (e.g., shared libraries, heap, stack, etc.). Its output report includes the starting address of the memory region (virtual memory), the total size of the region (KB), the actual physical memory occupied (KB), the mapped file or description (e.g., shared libraries, heap, stack, etc.), dirty page size, permissions, and other information. The same shared library file may correspond to multiple entries because the shared library is divided into multiple segments.

[0025] For example, after a critical process, tools such as pagemap can be used to collect the mapping relationship between virtual memory pages and physical memory pages of the target process. By reading the pagemap, the physical page frame corresponding to the virtual memory page of the process can be determined. The pagemap is a binary file that provides status information for each memory page. Each virtual memory page (usually 4KB) corresponds to a 64-bit (8-byte) entry, which includes status information such as whether it exists in physical memory (Present / Absent), physical page frame number (PFN, Page Frame Number), whether it has been modified (Dirty), whether it has been swapped to disk (Swapped), whether it has been locked (Locked), and the permissions of the memory page (Read / Write / Execute). This invention avoids data errors caused by single sampling by performing multiple data collections.

[0026] Step 2: The script parses the collected data and generates a report describing the virtual memory pages that need to be locked.

[0027] In this embodiment, the present invention uses a script program to parse the collected "virtual memory mapping status" and "virtual memory page to physical memory page mapping relationship," and extracts key information from them: the mapping target (such as executable program, shared library, etc.) of each virtual memory page in the target process, and whether the physical memory frame corresponding to each virtual memory page exists in physical memory. Finally, the two parts of data are correlated to generate a report.

[0028] For example, the virtual memory mapping analysis includes: In this invention, the key focus is on the starting address (virtual memory) VAddr of the memory region in the pmap output report, the total size of the region (KB) Vss, the actual physical memory occupied (KB) Pss, and the mapping information (such as shared libraries, heap, stack, etc.). Specifically, by traversing the pmap report, retrieving and recording mapping information where the Pss data after a critical process shows an increase compared to before the critical process, these are entries for shared library files. These data entries are the data that needs to be processed in this solution, because the increase in Pss data indicates that these shared library files are active in the target application scenario, resulting in memory access and page faults.

[0029] For example, resolving the mapping relationship from virtual memory pages to physical memory pages includes: based on the VAddr and Vss data in the pmap data, the virtual memory page number (VPN) range corresponding to each data entry to be processed can be calculated using the following formula:

[0030]

[0031] The virtual memory page size is 4KB, therefore the virtual memory page number is the virtual memory address divided by 4096. Thus, based on the calculated virtual memory page number, the corresponding physical memory page frame information in the pagemap file can be located. This solution focuses on whether the page frame exists in physical memory (Present / Absent).

[0032] Each entry in the Pagemap is 64 bits (8 bytes), of which 63 bits describe whether the current virtual memory page exists in physical memory (1 indicates existence, 0 indicates non-existence).

[0033] The collected data is parsed using the aforementioned script, resulting in a preliminary data report. This report describes which virtual memory pages of the specific file of interest in this technical solution are actually loaded into physical memory in the target scenario (i.e., it describes the virtual memory pages that need to be locked). Step 3: Construct a data structure based on the memory locking strategy, and configure the memory segment / memory page locking information using a file with a specific format.

[0034] In this embodiment, the present invention preloads the hot memory range based on the collected hot memory information and keeps it resident in physical memory, i.e., a hot memory page-locking scheme. However, the present invention does not perform page locking precisely on all hot memory. The main considerations of the present invention include: a. mlock is a system call that incurs some initial overhead and is not recommended to be called frequently. Therefore, when formulating a hotspot locking strategy, it is necessary to minimize the number of mlock calls. b. Hotspot latching requires a lot of debugging and verification work. In order to save manpower costs, hotspot latching is only applied to files that can bring significant memory optimization. c. Reduce coding complexity and difficulty.

[0035] For example, based on comprehensive evaluation, the present invention formulates the following hotspot latching strategy: a. Locking hot memory separately is only suitable when both "hot memory pages" and "non-hot memory pages" are large contiguous blocks of memory, and the proportion or absolute size of "non-hot memory pages" in the memory segment exceeds a set threshold. Otherwise, locking the entire memory segment directly, or loading and locking the entire file using conventional optimization methods, is better. Executable files such as ELF files require consideration of locking the entire memory segment or locking the entire file, while ordinary non-executable files only require consideration of locking the entire file. This invention's technical solution only applies to segments where "non-hot memory pages" account for more than 50% of the memory segment, or where the absolute size of "non-hot memory pages" is greater than 100KB.

[0036] b. Hotspot latching is only performed on shared library files whose expected optimization size (Pss(so)-Pss(hot_point)) is greater than 100KB.

[0037] c. Lock memory for a minimum of 4 consecutive pages (16KB).

[0038] In this embodiment, the present invention designs a suitable data structure and uses a configuration file to describe files that conform to the above strategy and their corresponding memory segment / memory page locking information. The data structure designed by the present invention includes the following necessary information: File path: Describes the path to the shared library file or executable file of the memory to be locked; Memory locking strategies: The memory locking strategies are described for each segment of this file, including three strategies: no memory locking, full segment memory locking, and segmented memory locking. Locked memory segment start page index: Describes the starting page number of the contiguous memory pages corresponding to each segment when the file uses a segmented memory locking strategy; it only takes effect when the segment uses a segmented memory locking strategy.

[0039] Locked memory segment termination page index: Describes the termination page number of the consecutive memory pages corresponding to each segment when the file uses a segmented memory locking strategy; it only takes effect when the segment uses a segmented memory locking strategy.

[0040] When using a segmented memory locking strategy, the present invention will lock all contiguous memory from the “start page index of the locked memory segment” to the “end page index of the locked memory segment” in the configured corresponding segment.

[0041] Step 4: At the beginning of process startup, read the configuration file and load hot memory into the physical memory.

[0042] In this embodiment, for executable linkable files (shared libraries, etc.), after the implicit or explicit loading is completed, the present invention dynamically traverses the process's list of shared objects (i.e., all dynamically linked libraries loaded by the current process) through the dl_iterate_phdr system interface to obtain information such as the starting address of each segment of the shared object. Based on the memory locking strategy configured in the configuration file and the starting and ending page indices of the locked memory segment, the address and length of the memory region to be locked are calculated, and physical memory resident is achieved through the mlock interface. For ordinary non-executable linkable files (data files, etc.), and executable files that require locking the entire file's memory, virtual memory mapping can be completed through the mmap interface, and then physical memory resident is achieved through the mmap interface.

[0043] Step 5: When users need to access relevant file resources, they can directly access the data already loaded in memory without having to perform I / O again, thus improving access speed.

[0044] Example 2 In this embodiment, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the hotspot-based memory access method in Embodiment 1.

[0045] Example 3 In this embodiment, the technical solution of the present invention accurately collects and loads hot memory in key application scenarios into physical memory, thereby improving the performance of key application processes in the software system while minimizing the occupation of resident physical memory and enhancing the overall performance of the software system. Furthermore, the present invention uses the loading of shared libraries (dynamic link libraries) in the software system as an example (the same applies to ordinary resource files) to demonstrate the differences and advantages of the technical solution of the present invention compared to conventional solutions.

[0046] For example, the analysis of the no-optimization scheme, the conventional optimization scheme, and the present technical solution is as follows: No optimization solution: combined Figure 2 As shown, the process of a software system accessing shared library resources without any special processing includes: When a process starts, it uses the `execve` system call to launch the loader. The kernel parses the main program's ELF file and uses the dynamic linker to load the required shared libraries. During the shared library loading process, the kernel parses the PhdrTable and allocates memory for the shared libraries in the process's virtual memory space using the `mmap` system call. If immediate binding mode (BIND_NOW) is enabled, the dynamic linker will also perform symbol resolution and relocation.

[0047] When a process first accesses a symbol (variable or function) in a shared library (if immediate binding mode is not enabled, the dynamic linker will first perform symbol resolution and relocation), the program needs to access physical memory, which triggers a page fault, and waits for disk I / O to copy the relevant data from the shared library file to physical memory.

[0048] Conventional optimization scheme: combined with Figure 2 As shown, when the entire file is loaded (mmap) and resident (mlock) in physical memory, the process of the software system accessing shared library resources includes: When a process starts, it uses the `execve` system call to launch the loader. The kernel parses the main program's ELF file and uses the dynamic linker to load the required shared libraries. During the shared library loading process, the kernel parses the PhdrTable and allocates memory for the shared libraries in the process's virtual memory space using the `mmap` system call. If immediate binding mode (BIND_NOW) is enabled, the dynamic linker will also perform symbol resolution and relocation.

[0049] After the process starts (in the main function), the program actively maps the shared library files to the virtual memory space using the mmap system call and locks them using the mlock system call, making them resident in physical memory. When mlock is executed, a page fault is triggered, and the relevant data is copied from the shared library files to physical memory via disk I / O and locked.

[0050] When a process accesses a symbol (variable or function) in a shared library for the first time (if immediate binding mode is not enabled, the dynamic linker will first perform symbol resolution and relocation), since the data already exists in physical memory, a page fault will not be triggered, thus avoiding disk I / O and optimizing program performance.

[0051] This technical solution: combines Figure 4 As shown, when a portion of a file is loaded (mmap) and resident (mlock) in physical memory based on a hotspot, the process of the software system accessing shared library resources includes: When a process starts, it uses the `execve` system call to launch the loader. The kernel parses the main program's ELF file and uses the dynamic linker to load the required shared libraries. During the shared library loading process, the kernel parses the PhdrTable and allocates memory for the shared libraries in the process's virtual memory space using the `mmap` system call. If immediate binding mode (BIND_NOW) is enabled, the dynamic linker will also perform symbol resolution and relocation.

[0052] Since the shared library files have already been mmap-mapped into the virtual memory space during process startup, the program does not need to actively map the shared library files into the virtual memory space via the mmap system call. Instead, it uses the dl_iterate_phdr system call to traverse the list of shared objects already loaded by the process and uses the mlock system call to lock their hot memory pages, keeping them resident in physical memory. When mlock is executed, a page fault is triggered, and the relevant data is copied from the shared library files to physical memory via disk I / O and locked.

[0053] When a process accesses a symbol (variable or function) in a shared library for the first time (if immediate binding mode is not enabled, the dynamic linker will first perform symbol resolution and relocation), since the data already exists in physical memory, a page fault will not be triggered, thus avoiding disk I / O and optimizing program performance.

[0054] Clearly, compared to no optimization and conventional optimization solutions, this technical solution offers significant overall performance improvements. Compared to no optimization, this solution improves process performance during critical flows because it preloads and keeps critical data from shared libraries in physical memory at startup. Compared to conventional optimization solutions, this solution reduces resident physical memory usage while maintaining the same performance during critical flows, saving valuable physical memory resources for the software system.

[0055] In summary, this invention collects hotspot memory data in critical application scenarios of software systems and improves performance in these scenarios by pre-loading and resident it in physical memory. Compared to conventional solutions that map and resident the entire file in physical memory, this solution uses less resident physical memory and achieves higher memory resource utilization. Furthermore, this technical solution applies resident physical memory only to critical nodes without increasing hardware or manufacturing costs, thus achieving optimal performance with minimal resident physical memory usage. During software system execution, this solution also reduces system computation and file I / O load, resulting in shorter execution time and superior overall performance compared to existing technologies.

[0056] It should be noted that, in this invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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.

[0057] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A memory access method based on hotspots, characterized in that: The following steps are included: Step 1: Collect the virtual memory mapping information of the target process, as well as the mapping relationship between the target process's virtual memory pages and physical memory pages; Step 2: Use the written script to parse the collected virtual memory mapping information and the mapping relationship between virtual memory pages and physical memory pages, and generate a report describing the virtual memory pages that need to be locked; Step 3: Develop a memory locking strategy, construct a data structure based on the memory locking strategy, and configure memory segment / page locking information using a file in a specific format. The data structure includes: file path, memory locking strategy, starting page index of the memory locking segment, and ending page index of the memory locking segment. Step 4: At the beginning of process startup, the configuration file is read, and hot memory is loaded and made resident in physical memory; The loading and resident physical memory of execution hotspot memory includes: preloading and resident physical memory only for hotspot memory of the target process being collected; Step 5: When a user needs to access relevant file resources, they can directly access the data already loaded in memory.

2. The memory access method based on hotspots according to claim 1, characterized in that: Collect information on the virtual memory mapping of the target process: display the process's address space layout and memory usage details; The process of collecting the mapping relationship between virtual memory pages and physical memory pages of the target process includes: displaying the physical page frames corresponding to the virtual memory pages of the process. Each virtual memory page corresponds to an entry containing information such as whether it exists in physical memory, the physical page frame number, whether it has been modified, whether it has been swapped to disk, whether it is locked, and the status information of the memory page permissions.

3. The memory access method based on hotspots according to claim 2, characterized in that: Step two also includes extracting the following two key pieces of information from the collected virtual memory mapping information of the target process and the mapping relationship between the target process's virtual memory pages and physical memory pages: The mapping targets of each virtual memory page in the target process; Does the physical memory frame corresponding to each virtual memory page exist in physical memory? The two key pieces of information are correlated to generate and output a report. The report includes the starting address of the memory region, the total size of the memory region, the actual physical memory size occupied, the mapped file or description, the dirty page size, and permission information. The description includes a description of the virtual memory pages that need to be locked in the process.

4. The memory access method based on hotspots according to claim 3, characterized in that: The script program was used to parse the collected virtual memory mapping information, including: Iterate through the output reports; Retrieve and record the actual physical memory size used after a predefined critical process; The actual physical memory size data and the file or description information that has an incremental mapping before the defined critical process are used as data entries for the shared library file. Data entries are the data that needs to be processed. When there is an increase in the actual physical memory size occupied, it is determined that the shared library file is active in the target process, resulting in memory access and page faults.

5. The memory access method based on hotspots according to claim 4, characterized in that: The script program was used to parse the collected mapping relationship between virtual memory pages and physical memory pages, including: Iterate through the output reports; Based on the starting address and total size of the memory region in the report, calculate the virtual memory page number range corresponding to each data entry to be processed, and obtain the virtual memory page number. Locate the corresponding physical memory page frame in the virtual memory mapping based on the virtual memory page number, determine whether the physical memory page frame exists in physical memory, and output the result of the existence or non-existence.

6. The memory access method based on hotspots according to claim 5, characterized in that: The memory locking strategy defined in step three includes: Hot memory is latched only when both "hot memory pages" and "non-hot memory pages" are large contiguous blocks of memory, and the proportion of "non-hot memory pages" in the memory segment exceeds a set threshold or the absolute size exceeds a set threshold. Otherwise, the entire memory segment is latched. Hotspot latching is only applied to shared library files for which the expected optimization amount exceeds a set threshold. Set a minimum memory lock for n consecutive pages.

7. A hotspot-based memory access method according to claim 6, characterized in that: In data structures: File path: Describes the path to the shared library file or executable file of the memory to be locked; Memory locking strategies: The memory locking strategies are described separately for each segment of the file, including three strategies: no memory locking, full segment memory locking, and segmented memory locking. Locked memory segment start page index: The start page number of the contiguous memory pages corresponding to each segment when the memory is locked in segments of the description file; it only takes effect when the segment-locked memory strategy is used in each segment; Locked memory segment termination page index: The termination page number of the contiguous memory pages corresponding to each segment when the memory is locked in segments of the description file; it only takes effect when the segment-locked memory strategy is used.

8. The memory access method based on hotspots according to claim 7, characterized in that: When a fragmented memory locking strategy is used in the memory locking strategy, the entire contiguous memory from the start page index to the end page index of the corresponding memory segment is locked.

9. A hotspot-based memory access method according to claim 8, characterized in that: In step four: For executable and linkable files: After they are implicitly or explicitly loaded, the system interface is used to dynamically traverse the process's list of shared objects to obtain the starting address information of each segment of the shared object; the address and length of the memory region to be locked are calculated based on the memory locking policy configured in the configuration file and the starting page index and ending page index of the locked memory segment. Physical memory persistence is achieved through an interface; For ordinary non-executable linkable files, and executable files that require the entire file to lock memory: virtual memory mapping and physical memory resident are accomplished through the interface.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements a hotspot-based memory access method as described in any one of claims 1-9.