This Article 
 Bibliographic References 
 Add to: 
A High-Performance Memory Allocator for Object-Oriented Systems
March 1996 (vol. 45 no. 3)
pp. 357-366

Abstract—Object-oriented programming languages tend to allocate and deallocate blocks of memory very frequently. The growing popularity of these languages increases the importance of high-performance memory allocation. For speed and simplicity in memory allocation, the buddy system has been the method of choice for nearly three decades. A software realization incurs the overhead of internal fragmentation and of memory traffic due to splitting and coalescing memory blocks. This paper presents a simple hardware design for buddy-system allocation that takes advantage of the speed of a pure combinational-logic implementation. Two binary trees formed by anding and oring propagate information about the allocation status of blocks and subblocks. They implement a nonbacktracking search for the address of the first free block that is large enough to satisfy a request.

Although the buddy system may allocate a block that is much larger than the requested size, the logic that finds a free block can be augmented by a "bit-flipper" to relinquish the unused portion at the end of the block. This effectively eliminates internal fragmentation. Simulation results show that the buddy system modified in this way uses less memory in most, though not all, programs than the unmodified buddy. Hence, the hardware buddy-system allocator is faster and uses memory more efficiently than the standard software approach.

[1] A.A. Abonamah,"Resource Allocation Strategies for Hypercube Architectures," Information Sciences, vol. 64, no. 3, pp. 251-269, Oct. 1992.
[2] R.E. Barkley and T.P. Lee,"A Lazy Buddy System Bounded by Two Coalescing Delays per Class," Proc. 12th Symp. Operating Systems Principles, vol. 23, no. 5, pp. 167-176, Dec. 1989.
[3] L. Bic and A.C. Shaw,The Logical Design of Operating Systems, second edition, pp. 210-216.Englewood Cliffs, N.J.: Prentice Hall, 1988.
[4] B. Calder,D. Grunwald, and B. Zorn,"Quantifying Behavioral Differences Between C and C++ Programs," Technical Report CU-CS-698-94, Computer Science Dept., Univ. of Colorado, Jan. 1994. Submitted to J. Programming Languages.
[5] J.M. Chang and E.F. Gehringer,"Object Caching for Performance in Object-Oriented Systems," Proc. IEEE Int'l Conf. Computer Design, pp. 379-385, Oct. 1991.
[6] J.M. Chang,"A Coprocessor Architecture for Memory Management in Object-Oriented Systems," PhD thesis, North Carolina State Univ., Aug. 1993.
[7] J.M. Chang and E.F. Gehringer, “Evaluation of an Object-Caching Coprocessor Design for Object-Oriented Systems,” Proc. IEEE Int'l Conf. Computer Design, pp. 132-139, 1993.
[8] S. Isoda,E. Goto, and I. Kimura,"An Efficient Bit Table Technique for Dynamic Storage Allocation of 2nWord Blocks," Comm. ACM, vol. 7, pp. 589-592, Sept. 1971.
[9] A. Kaufman,"Tailored-List and Recombination-Delaying Buddy System," ACM Trans. Programming Languages and Systems, vol. 6, no. 1, pp. 119-125, Jan. 1984.
[10] K.C. Knowlton, “A Fast Storage Allocator,” Comm. ACM, vol. 8, pp. 623-625, Oct. 1965.
[11] D.E. Knuth, The Art of Computer Programming, vol. 1,Addison Wesley, second ed. 1973.
[12] P.D. Koch,"Disk File Allocation Based on the Buddy System," ACM Trans. Computer Systems, vol. 5, no. 4, pp. 353-370, Nov. 1987.
[13] I.P. Page and J. Hagins,"Improving the Performance of Buddy Systems," IEEE Trans. Computers, vol. 35, no. 5, pp. 441-447, May 1986.
[14] J.L. Peterson and T.A. Norman,"Buddy Systems," Comm. ACM, vol. 20, pp. 421-431, June 1977.
[15] E.V. Puttkamer,"A Simple Hardware Buddy System Memory Allocator," IEEE Trans. Computers, vol. 24, no. 10, pp. 953-957, Oct. 1975.
[16] I. Williams and M. Wolczko,"An Object-Based Memory Architecture," Proc. Fourth Workshop Persistent Object Systems, pp. 111-127, Martha's Vineyard, Mass., Sept. 1990.
[17] P.R. Wilson and T.G. Moher,"Design of the Opportunistic Garbage Collector," Proc. OOPSLA '89 (ACM SIGPLAN Notices, vol. 24, no. 10), pp. 23-35, Oct. 1989.
[18] B. Zorn,"Custo-Malloc: Efficient Synthesized Memory Allocators," Technical Report CU-CS-602-92, Computer Science Dept., Univ. of Colorado, July 1992.
[19] B. Zorn,"The Empirical Measurements of Six Allocation-Intensive C Programs," ACM SIGPLAN Notices, vol. 27, no. 12, pp. 71-80, Dec. 1992.
[20] B. Zorn,"The Measured Cost of Conservative Garbage Collection," Software-Practice and Experience, vol. 23, no. 7, pp. 733-756, July 1993.

Index Terms:
Buddy system, object-oriented systems, bit-vector allocation, binary tree, dynamic memory management, internal fragmentation.
J. Morris Chang, Edward F. Gehringer, "A High-Performance Memory Allocator for Object-Oriented Systems," IEEE Transactions on Computers, vol. 45, no. 3, pp. 357-366, March 1996, doi:10.1109/12.485574
Usage of this product signifies your acceptance of the Terms of Use.