Adaptive Layered Segregated Fit Scheme for Dynamic Memory Allocation

Author(s):  
Yuqian Guan ◽  
Jian Guo

Embedded applications are becoming more complex and are required to utilize computing platform resources more efficiently. Existing dynamic memory allocation (DSA) schemes cannot adaptively perform memory management according to the environment in which they are located or integrate various memory allocation strategies, making it impossible to guarantee a constant execution time. Efficient memory utilization is a crucial challenge for developers, especially in embedded OSs (operating systems). In this paper, we propose an adaptive layered segregated fit (ALSF) scheme for DSA. The ALSF scheme combines dynamic two-dimensional arrays and bitmaps, completes the allocation and freeing of memory blocks within constant execution time, and uses memory splitting technology to reduce internal fragmentation. The proposed scheme also adjusts the number of segregated lists by analyzing the system’s allocation of different memory sizes, which improves the matching accuracy of memory blocks. We conducted a comparative experimental analysis and investigation of the ALSF and two-level segregated fit (TLSF) schemes in the Zephyr OS. Experiments show that the average memory utilization of the proposed ALSF scheme reaches 94.95%. Compared with the TLSF scheme, our scheme has a 12.99% higher allocation success rate in the memory-scarce environment, and the execution speeds of the two are similar.

Author(s):  
Joseph F. Boudreau ◽  
Eric S. Swanson

While there is no such thing as a “typical” C++ class, several common syntactical constructs lend themselves to extremely widespread use and must be mastered by C++ programmers. To motivate the discussion of software design at the level of the C++ class, examples from computer science and optics are introduced. Important syntactical elements such as constructors, destructors, copy constructors, assignment operators, cast operators, and const qualifiers, together with function overloading, operator overloading, and dynamic memory allocation are discussed. These concepts, illustrated with examples from physics, are presented and explained. Further examples from optical and quantum mechanical problems are left to the exercises. This chapter and its exercises gives the reader sufficient information to begin developing his or her own classes and to experiment with class design through trial and error.


Sign in / Sign up

Export Citation Format

Share Document