Buddy Algorithm Optimization in Linux Memory Management
Zhao Fei Meng, Shudong Zhang · Applied Mechanics and Materials · 2013
Buddy algorithm is one of the classical algorithms for Linux Memory Management. In buddy algorithm, free memory blocks, even if they have the same size and consecutive address, they cant be combined into a larger memory space because they dont have a partnership. For these shortcomings of the algorithm, this paper proposes an improved buddy algorithm which mainly include in the main data structure adding an array and a variable respectively to record the starting address and the number of two adjacent free memory blocks which are in the linked list of last order and do not meet the partnership, at the same time, improving memory allocation management and memory recovery management.By experiment, when the memory space is insufficient and memory allocation request is frequent, the improved algorithm can effectively reduce the number of failed memory requests and improve the memory utilization.