A high-performance space saving dynamic memory manager
J. Morris Chang, Y. Hasan · 2005
Managing program dynamic memory can consume up to 60% of program execution time. Object oriented languages like C++ allocate dynamic memory prolifically. Since computer memory is a limited resource its efficient utilization is required to minimize wastage and keep costs down. It is known that different memory allocation algorithms perform differently some being more expensive in terms of total heap memory usage than others. The processing time cost of memory allocation and deallocation also varies widely with allocating algorithms. Allocation algorithms such as best fit seem to minimize memory consumption while segregated storage algorithms minimize the time cost. There is usually a tradeoff between time and space costs. The goal of a good allocation algorithm is to find a reasonable balance between the two. Fragmentation of the heap space is the basic problem of dynamic memory management but it has been poorly understood. It can lead to heap memory waste. In this study we have clearly defined and measured fragmentation. We have also developed a tunable segregated fit allocation algorithm based on known data about the dynamic memory behavior of programs that shows excellent performance and memory usage. It is also shown that dynamic memory waste is unavoidable in some programs.