Skip to Main Content
The importance of dynamic memory management has increased significantly as there is a growing number of developments in object-oriented programs. Many studies show that dynamic memory management is one of the most expensive components in many software systems. In C++ programs especially, it tends to have prolific object creation and deletion. These objects tend to have short life-spans. This paper presents a dynamic memory allocation strategy to reuse these objects to speed up the object management. This object reuse scheme is implemented through the overloading C++ operators, new and delete. The C++ allocation patterns are studied thoroughly in this paper. Over 90% of objects are not bigger than 512 bytes and allocated prolifically. The proposed scheme is made feasible by reuse of these small objects. Our allocation scheme is simple and fast because it requires no splitting and no coalescing, and reduces the number of malloc() calls. It maintains its own free-list which is used for object reuse. The experimented results, based on the proposed allocation scheme, show that allocation speed is increased up to four times compared to other well-known algorithms. Our scheme is purely source-code oriented and built on top of malloc. Therefore, this approach is portable for application to existing code and safe to use with different mallocs.