## 1 Introduction
### Related Works  
As a key technology that directly affects system performance and resource utilization, there have been extensive research efforts from different perspectives on improving memory allocation efficiency. [PERSON] et al. [14] proposed a memory allocation mechanism called Hermes, which improves the speed of handling latency-sensitive tasks under memory pressure through fast allocation and proactive memory reclamation. [PERSON] et al. [15] proposed a memory allocation and migration mechanism in a hybrid memory system, which effectively improves system performance by using performance/energy models to guide memory allocation and object migration between NVM and DRAM. [PERSON] et al. [16] proposed a dynamic degree memory balanced allocation algorithm as a solution for task scheduling. This algorithm schedules virtual machines based on the availability of memory and microprocessors, resulting in significant performance improvements compared to other load balancing algorithms. [PERSON] et al. [17] designed an elastic memory management scheme called Spring Buddy suitable for highly concurrent environments. It significantly reduces the latency of memory allocation and deallocation by adjusting the focus of concurrent response or resource aggregation based on different memory request patterns to adapt to concurrency pressure. [PERSON] et al. [18] studied memory-intensive applications in real-time and mixed-criticality systems and proposed a scheme to adjust memory bandwidth allocation by dynamically monitoring application progress. Its effectiveness was demonstrated through benchmark testing. Most of these studies on memory allocation are conducted based on relatively abundant memory resources, and the resulting algorithms or allocation mechanisms need to operate in an environment with a large amount of available memory for allocation. Dynamic programming, as a mature method for solving optimization problems in decision-making processes, has been widely applied in various fields. In recent research, [PERSON] et al. [19] developed effective energy management strategies using dynamic programming to address a multi-objective optimal control problem involving power loss, battery thermal management requirements, and battery health performance. [PERSON] et al. [20] used approximate dynamic programming methods to solve the constrained outbound service demand management problem, effectively reducing potential penalty losses by coordinating feasible time windows and estimating opportunity costs. [PERSON] et al. [21] modeled the electric bus fleet scheduling problem as a dynamic programming model, significantly reducing battery replacement investments by minimizing battery replacement costs. [PERSON] et al. [22] proposed an energy station planning method for distributed energy systems, optimizing the energy supply range of energy stations using 0-1 dynamic programming and demonstrating its effectiveness in reducing investment and costs through a campus area case study. Multiple studies have shown that dynamic programming has good performance in resource allocation problems under limited dimensions. PLCs, as an important technological foundation for industrial process automation, can be assumed to continue to be widely used in future production, even in the era of Industry 4.0 and the Industrial Internet [23]. The concept of edge PLCs is a good example of the continued use of PLCs in future production. Edge PLCs need to adapt to the architecture of edge computing by upgrading existing systems, creating new designs, and enhancing security [24]. There have been many studies on how to improve the efficiency of edge PLCs. [PERSON] et al. [25] proposed a fault diagnosis optimization method for edge PLCs based on a random forest approach to handle feature selection problems, effectively improving the performance of fault diagnosis. [PERSON] et al. [26] discussed the possibility of applying small PLCs in edge computing and demonstrated it with an example of measuring and monitoring cylinders. [PERSON] et al.