A memory management method for CAE software iterative solution method
By preloading the memory management library and establishing a memory pool when the CAE software starts, and dynamically adjusting the size of the memory pool, the problem of low memory management efficiency in the iterative solution method of CAE software is solved, thereby improving computing performance and development efficiency.
Patent Information
- Application Number
- CN202511234176.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing CAE software iterative solution methods suffer from low memory management efficiency, resulting in poor overall performance. Existing methods also have drawbacks such as sparse matrix compression accuracy loss, heterogeneous computing compatibility bottlenecks, asynchronous communication data consistency issues, and insufficient AI prediction generalization ability.
When CAE software starts, the memory management library is preloaded to establish a front-end central memory pool and process memory pool. The central and process memory pools are dynamically adjusted through the memory profile database to reduce the operation between the memory allocation library and the system and optimize memory management.
It improves the memory management efficiency of CAE software, enhances computing performance and development efficiency, and strengthens market competitiveness.
Smart Images

Figure CN120743560B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CAE software technology, and specifically provides a memory management method for iterative solution methods in CAE software. Background Technology
[0002] Computer-aided engineering (CAE) software (such as ANSYS, COMSOL, LS-DYNA, etc.) is widely used in fields such as structural mechanics, fluid simulation, and electromagnetic analysis. Its computational processes involve large-scale numerical solutions (such as finite element method (FEM) and computational fluid dynamics (CFD), which place extremely high demands on memory management. Iterative solution methods (such as conjugate gradient method (CG), GMRES, multigrid method (MG), etc.) require repeated memory reads and writes, and their memory management efficiency directly affects computational efficiency and the scale of solvable problems.
[0003] To improve the memory management efficiency of iterative solution methods in CAE software, the following solutions exist:
[0004] 1. Algorithm optimization, such as mixed-precision storage. However, this method suffers from precision loss due to sparse matrix compression and real-time limitations of dynamic memory management.
[0005] 2. Hardware acceleration, such as GPU acceleration and new storage media. However, this approach faces compatibility bottlenecks in heterogeneous computing and reliability risks associated with new storage media.
[0006] 3. Distributed computing. However, this approach suffers from data consistency issues due to asynchronous communication and overall performance degradation caused by the mathematical complexity of load balancing.
[0007] 4. Emerging technologies, such as AI prediction and quantum hybrid computing. However, AI prediction has insufficient generalization ability, and quantum hybrid computing is limited by hardware computing power.
[0008] Existing methods exhibit a non-linear relationship between optimization benefits and complexity in engineering practice, and the simultaneous use of multiple methods carries the risk of synergistic conflicts. Summary of the Invention
[0009] To overcome the above-mentioned shortcomings, this invention is proposed to provide a solution to the problem of low overall performance caused by the low memory management efficiency of CAE software iterative solution methods.
[0010] This invention provides a memory management method for iterative solution methods in CAE software, comprising the following steps:
[0011] S1: Preload the memory management library when the CAE software starts;
[0012] S2: During the first iteration of the CAE software, the memory management library is called to allocate memory and establish a front-end central memory pool and a front-end process memory pool.
[0013] S3: Collect memory profile information during the first iteration and establish a memory profile database;
[0014] S4: In subsequent iterations of CAE software, the memory management library establishes a central memory pool based on the memory profile database;
[0015] S5: Before each iteration of the CAE software begins, a process memory pool is created for each process based on the memory profile database.
[0016] Furthermore, step S1 specifically includes:
[0017] When the CAE software starts, the memory management library is loaded via dynamic link library;
[0018] Call the initialization function of the dynamic link library, check whether the hardware support and the total system memory meet the minimum requirements. If the initialization fails, fall back to the system default allocator and log the process.
[0019] Register hook functions to forward memory allocation requests to the memory management library.
[0020] Furthermore, establishing a front-end central memory pool involves allocating large, contiguous blocks of memory from the system, reserving address space, and dividing it into blocks of fixed size.
[0021] Furthermore, establishing a front-end process memory pool includes pre-allocating sub-pools according to the number of processes, and each sub-pool is cut from the front-end central memory pool in a fixed proportion according to the rules of equal distribution or weighted distribution according to process priority.
[0022] Furthermore, the memory profile information includes the total memory allocation size, the memory allocation size of each process, and the total memory release size.
[0023] further,
[0024] In subsequent iterations of the CAE software, the memory management library establishes a central memory pool based on the total memory allocation size in the memory profile database.
[0025] Before each iteration of the CAE software begins, memory is allocated from the central memory pool according to the memory allocation size of each process in the memory profile database, and a process memory pool is established for each process.
[0026] Furthermore, it also includes the following steps:
[0027] After each iteration of the CAE software, it determines whether the total memory requirement of the current iteration is greater than the size of the central memory pool. If so, it triggers the expansion of the central memory pool.
[0028] If the total memory requirement after a preset number of iterations is less than the preset memory size, the central memory pool will be reduced in size.
[0029] Furthermore, it also includes the following steps:
[0030] In subsequent iterations of the CAE software, if the memory requirements of a process exceed the allocated process memory pool size, the process memory pool will be expanded.
[0031] If the idle rate of the process memory pool exceeds the preset ratio of the process memory pool for a continuous preset period of time, the process memory pool will be reduced in size.
[0032] Furthermore, memory allocation is intercepted in real time in the memory management library, so that memory is allocated through the process memory pool. If the process memory pool is insufficient, the size of the process memory pool is dynamically adjusted first. If the allocation needs are still not met, the size of the central memory pool is dynamically adjusted until the memory allocation is successful.
[0033] Furthermore, the memory management library intercepts memory releases in real time, filters out memory releases belonging to CAE software processes, and manages the released memory through a central memory pool. Once the CAE software has finished solving the problem, the memory in the central memory pool is returned to the system.
[0034] The working principle and beneficial effects of this invention:
[0035] In implementing the technical solution of this invention, a memory statistics database is established by statistically analyzing the memory access behavior of CAE software during the first iteration. Subsequent iterations dynamically adjust the central memory pool and process memory pool in the memory management library based on this database. This reduces memory allocation and release operations between the memory allocation library and the system, lowers memory allocation time, and improves memory management efficiency, thereby enhancing CAE software performance. Through this high-efficiency memory management method, CAE software development efficiency is improved, enhancing the market competitiveness of CAE software. Attached Figure Description
[0036] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Furthermore, similar numbers in the drawings are used to denote similar components, wherein:
[0037] Figure 1 This is a schematic diagram of the main steps of a memory management method for iterative solving in CAE software according to the present invention. Detailed Implementation
[0038] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0039] Example 1
[0040] Figure 1 This is a schematic diagram illustrating the main steps of a memory management method for iterative solving in CAE software according to the present invention. Figure 1 As shown, a memory management method for iterative solving in CAE software in this embodiment mainly includes the following steps S1-S5.
[0041] Step S1: Preload the memory management library when the CAE software starts.
[0042] In one implementation, step S1 specifically includes:
[0043] When CAE software starts, a memory management library is loaded via dynamic link libraries (such as .so files in Linux or .dll files in Windows) to prepare for calling the memory management interface. Explicit loading is done using dlopen (Linux) or LoadLibrary (Windows) to avoid implicit dependencies.
[0044] Call the initialization function of the dynamic link library (such as init_memory_manager()), check whether the hardware support (such as the need to bind memory nodes for NUMA architecture) and the total system memory meet the minimum requirements (such as 20% of the total physical memory). If the initialization fails, fall back to the system default allocator and log the process.
[0045] Register hook functions to forward memory allocation requests to the memory management library.
[0046] Step S2: During the first iteration of the CAE software, the memory management library is called to allocate memory and establish a front-end central memory pool and a front-end process memory pool for use in the first iteration process.
[0047] In one implementation, the steps for establishing a front-end central memory pool are as follows: allocate a large contiguous block of memory (e.g., 10% of the total physical memory) from the system, reserve the address space using mmap (Linux) or VirtualAlloc (Windows), divide it into fixed-size blocks (e.g., 4KB aligned), and reduce fragmentation.
[0048] In one implementation, the steps for establishing a front-end process memory pool are as follows: pre-allocate sub-pools according to the number of processes, and each sub-pool is cut from the front-end central memory pool by a fixed proportion (such as equal distribution or weighted according to process priority).
[0049] Furthermore, after the first iteration, the destroy_pre_memory_pool() function is called to release all memory from the pre-central memory pool and the pre-process memory pool to the system to avoid any residual memory.
[0050] Step S3: During the first iteration, collect memory profile information and establish a memory profile database.
[0051] In one implementation, the memory profile information includes the total memory allocation size, the memory allocation size of each process, and the total memory release size.
[0052] Step S4: In subsequent iterations of the CAE software, the memory management library establishes a central memory pool based on the total memory allocation size.
[0053] In one implementation, a central memory pool is obtained by allocating contiguous physical memory using mmap / VirtualAlloc, supporting huge pages to reduce TLB misses. Sentinel values (such as 0xDEADBEEF) are populated during initialization for debugging leaks.
[0054] Furthermore, the central memory pool is divided into multiple regions (e.g., by NUMA nodes), each controlled by an independent manager.
[0055] Step S5: Before each iteration of the CAE software begins, allocate corresponding memory from the central memory pool according to the memory allocation size of each process in the memory profile database, and establish a process memory pool for each process.
[0056] Based on steps S1-S5 above, a memory statistics database is established by statistically analyzing the memory access behavior of the CAE software in the first iteration. Subsequent iterations dynamically adjust the central memory pool and process memory pool in the memory management library based on this database, reducing memory allocation and release operations between the memory allocation library and the system, thereby improving memory management efficiency.
[0057] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.
[0058] Example 2
[0059] Based on the above embodiment 1, it also includes dynamically adjusting the size of the central memory pool and the process memory pool.
[0060] The size of the central memory pool is dynamically adjusted based on the total memory requirements of subsequent iterations of the CAE software, specifically including:
[0061] After each iteration, determine whether the total memory requirement of the current iteration is greater than the size of the central memory pool. If so, trigger the expansion of the central memory pool.
[0062] If the total memory requirement after a preset number of iterations is less than the preset memory size (e.g., 30% of the central memory pool), the central memory pool will be reduced in size (e.g., 50% of the central memory pool will be released).
[0063] The process memory pool size is dynamically adjusted based on the memory requirements of the process during subsequent iterations of the CAE software, specifically including:
[0064] In subsequent iterations of the CAE software, if the memory requirements of a process exceed the allocated size of the process memory pool, the process memory pool will be expanded (the corresponding memory will be allocated from the central memory pool to the process memory pool).
[0065] If the idle rate of the process memory pool is greater than the preset ratio of the process memory pool (e.g., 70%) for a continuous preset period of time, the process memory pool will be reduced in size (e.g., 50% of the space will be reclaimed to the central memory pool).
[0066] Example 3
[0067] Based on Example 1, it also includes memory allocation and release.
[0068] The memory management library intercepts memory allocation in real time, enabling memory to be allocated through the process memory pool. If the process memory pool is insufficient, the size of the process memory pool is dynamically adjusted according to the method in Example 2. If the allocation requirements are still not met, the size of the central memory pool is dynamically adjusted according to Example 2 until the memory allocation is successful.
[0069] The memory management library intercepts memory releases in real time, filters out memory releases belonging to CAE software processes, and manages the released memory through a central memory pool instead of returning it to the system. The memory in the central memory pool is returned to the system only after the CAE software has finished solving the problem.
[0070] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A memory management method for iterative solution methods in CAE software, characterized in that, Including the following steps: S1: Preload the memory management library when the CAE software starts; S2: During the first iteration of the CAE software, the memory management library is called to allocate memory and establish a front-end central memory pool and a front-end process memory pool. S3: Collect memory profile information during the first iteration and establish a memory profile database; S4: In subsequent iterations of CAE software, the memory management library establishes a central memory pool based on the memory profile database; S5: Before each iteration of the CAE software begins, a process memory pool is created for each process based on the memory profile database. The memory management library intercepts memory allocation in real time, enabling memory to be allocated through the process memory pool. If the process memory pool is insufficient, the size of the process memory pool is dynamically adjusted first. If this still cannot meet the allocation requirements, the size of the central memory pool is dynamically adjusted until the memory allocation is successful. Dynamically adjusting the process memory pool size includes: In subsequent iterations of the CAE software, if the memory requirements of a process exceed the allocated process memory pool size, the process memory pool will be expanded. If the idle rate of the process memory pool is greater than the preset ratio of the process memory pool for a continuous preset period of time, the process memory pool will be reduced in size. Dynamically adjusting the size of the central memory pool includes: After each iteration of the CAE software, it determines whether the total memory requirement of the current iteration is greater than the size of the central memory pool. If so, it triggers the expansion of the central memory pool. If the total memory requirement after a preset number of iterations is less than the preset memory size, the central memory pool will be reduced in size. After the first iteration is completed, the destroy_pre_memory_pool() function is called to release all memory of the pre-central memory pool and the pre-process memory pool to the system; The memory management library intercepts memory releases in real time, filters out memory releases belonging to CAE software processes, and manages the released memory through a central memory pool. Once the CAE software has finished solving the problem, the memory in the central memory pool is returned to the system.
2. The memory management method for iterative solution in CAE software according to claim 1, characterized in that, Step S1 specifically includes: When the CAE software starts, the memory management library is loaded via dynamic link library; Call the initialization function of the dynamic link library, check whether the hardware support and the total system memory meet the minimum requirements. If the initialization fails, fall back to the system default allocator and log the process. Register hook functions to forward memory allocation requests to the memory management library.
3. The memory management method for iterative solution in CAE software according to claim 1, characterized in that, Establishing a front-end central memory pool involves allocating large, contiguous blocks of memory from the system, reserving address space, and dividing it into blocks of fixed size.
4. The memory management method for iterative solution in CAE software according to claim 1, characterized in that, Establishing a front-end process memory pool involves pre-allocating sub-pools based on the number of processes, with each sub-pool being divided from the front-end central memory pool in a fixed proportion according to either equal distribution or weighted distribution based on process priority.
5. A memory management method for iterative solution in CAE software according to claim 1, characterized in that, The memory profile information includes the total memory allocation size, the memory allocation size of each process, and the total memory release size.
6. A memory management method for iterative solution in CAE software according to claim 5, characterized in that, In subsequent iterations of the CAE software, the memory management library establishes a central memory pool based on the total memory allocation size in the memory profile database. Before each iteration of the CAE software begins, memory is allocated from the central memory pool according to the memory allocation size of each process in the memory profile database, and a process memory pool is established for each process.
Citation Information
Patent Citations
Configuration method and device for built-in system memory pool
CN101937398A
Internal memory dynamic distribution method and system
CN104111892A