The Hoard Memory Allocator

"...if you'll be running on multiprocessor machines, ... use Emery Berger's excellent Hoard multiprocessor memory management code. It's a drop-in replacement for the C and C++ memory routines and is very fast on multiprocessor machines." Debugging Applications for Microsoft .NET and Microsoft Windows, Microsoft Press

"(to improve scalability,) consider an open source alternative such as the Hoard Memory Manager..."Windows System Programming, Addison-Wesley


Digg thisDigg this | Add to your del.icio.us accountdel.icio.us

The Hoard memory allocator is a fast, scalable, and memory-efficient memory allocator. It runs on a variety of platforms, including Linux, Solaris, and Windows. Hoard is a drop-in replacement for malloc() that can dramatically improve application performance, especially for multithreaded programs running on multiprocessors. No change to your source is necessary. Just link it in or set just one environment variable (see Using Hoard for more information).


Download Hoard [version 3.8, Nov 9, 2009]

Softpedia Award Get on the Hoard-Announce list to get notifications of new releases (very low traffic).
See the DH page for a memory allocator that eliminates memory errors.

Press

Who's Using Hoard?

Companies using Hoard in their products and servers include AOL, British Telecom, Blue Vector, Business Objects (formerly Crystal Decisions), Cisco, Entrust, InfoVista, Kamakura, Novell, Oktal SE, OpenText, OpenWave Systems (for their Typhoon and Twister servers), Pervasive Software, Plath GmbH, Quest Software, Reuters, and Sonus Networks, and Tata Communications.

Open source projects using Hoard include the Asterisk Open Source Telephony Project, Bayonne GNU telephony server, the Cilk parallel programming language, the GNU Common C++ system, the OpenFOAM computational fluid dynamics toolkit, and the SafeSquid web proxy.

Hoard is also a part of several major Linux distributions, including Mandriva and Novell's SuSe. Hoard is distributed under the GPL, but is also can be licensed for commercial use.

More Information

First, read the FAQs.

If you have questions not answered there, you can search the mailing list archives of the Hoard mailing list, which is also a great place to ask questions.

Why Hoard?

There are a number of problems with existing memory allocators that make Hoard a better choice.

Contention

Multithreaded programs often do not scale because the heap is a bottleneck. When multiple threads simultaneously allocate or deallocate memory from the allocator, the allocator will serialize them. Programs making intensive use of the allocator actually slow down as the number of processors increases. Your program may be allocation-intensive without you realizing it, for instance, if your program makes many calls to the C++ Standard Template Library (STL).

False Sharing

The allocator can cause other problems for multithreaded code. It can lead to false sharing in your application: threads on different CPUs can end up with memory in the same cache line, or chunk of memory. Accessing these falsely-shared cache lines is hundreds of times slower than accessing unshared cache lines.

Blowup

Multithreaded programs can also lead the allocator to blowup memory consumption. This effect can multiply the amount of memory needed to run your application by the number of CPUs on your machine: four CPUs could mean that you need four times as much memory. Hoard is a fast allocator that solves all of these problems.

Technical Information

For technical details of a previous version of Hoard, read Hoard: A Scalable Memory Allocator for Multithreaded Applications, by Emery D. Berger, Kathryn S. McKinley, Robert D. Blumofe, and Paul R. Wilson. The Ninth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-IX). Cambridge, MA, November 2000.