Suite for benchmarking malloc implementations.
513
stars
474
commits
C
primary language
Sep 2, 2026
updated
Suite for benchmarking malloc implementations, originally
developed for benchmarking mimalloc.
Collection of various benchmarks from the academic literature, together with
automated scripts to pull specific versions of benchmark programs and
allocators from Github and build them.
Due to the large variance in programs and allocators, the suite is currently
only developed for Unix-like systems, and specifically Ubuntu with apt-get, Fedora with dnf,
and macOS (for a limited set of allocators and benchmarks).
The only system-installed allocator used is glibc's implementation that ships as part of Linux's libc.
All other allocators are downloaded and built as part of build-bench-env.sh --
if you are looking to run these benchmarks on a different Linux distribution look at
the setup_packages function to see the packages required to build the full set of
allocators.
It is quite easy to add new benchmarks and allocator implementations -- please do so!.
Enjoy, Daan
Note that all the code in the bench directory is not part of
mimalloc-bench as such, and all programs in the bench directory are
governed under their own specific licenses and copyrights as detailed in
their README.md (or license.txt) files. They are just included here for convenience.
The build-bench-env.sh script with the all argument will automatically pull
all needed benchmarks and allocators and build them in the extern directory:
~/dev/mimalloc-bench> ./build-bench-env.sh all
It starts installing packages and you will need to enter the sudo password.
All other programs are build in the mimalloc-bench/extern directory.
Use ./build-bench-env.sh -h to see all options.
If everything succeeded, you can run the full benchmark suite (from out/bench) as:
~/dev/mimalloc-bench> cd out/bench~/dev/mimalloc-bench/out/bench>../../bench.sh alla alltOr just test mimalloc and tcmalloc on cfrac and larson with 16 threads:
~/dev/mimalloc-bench/out/bench>../../bench.sh --procs=16 mi tc cfrac larsonGenerally, you can specify the allocators (mi, je,
tc, hd, sys (system allocator)) etc, and the benchmarks
, cfrac, espresso, barnes, lean, larson, alloc-test, cscratch, etc.
Or all allocators (alla) and tests (allt).
Use --procs=<n> to set the concurrency, and use --help to see all supported
allocators and benchmarks.
Supported allocators are as follow, see build-bench-env.sh for the versions:
The first set of benchmarks are real world programs, or are trying to mimic some, and consists of:
cfrac and espresso but is multithreaded../lean --make -j N). Big real-world workload with intensive
allocations.The second set of benchmarks are stress tests and consist of:
94f6cb
(master, 2018-07-04)Finally, there is a security benchmark aiming at checking basic security properties of allocators.
Below is an example (Apr 2019) of the benchmark results on an HP Z4-G4 workstation with a 4-core Intel® Xeon® W2123 at 3.6 GHz with 16GB ECC memory, running Ubuntu 18.04.1 with LibC 2.27 and GCC 7.3.0.
Memory usage:
(note: the xmalloc-testN memory usage should be disregarded is it allocates more the faster the program runs. Unfortunately, there are no entries for SuperMalloc in the leanN and xmalloc-testN benchmarks as it faulted on those)
[1] Emery D. Berger, Kathryn S. McKinley, Robert D. Blumofe, and Paul R. Wilson. Hoard: A Scalable Memory Allocator for Multithreaded Applications the Ninth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-IX). Cambridge, MA, November 2000. pdf
[2] P. Larson and M. Krishnan. Memory allocation for long-running server applications. In ISMM, Vancouver, B.C., Canada, 1998. pdf
[3] D. Grunwald, B. Zorn, and R. Henderson. Improving the cache locality of memory allocation. In R. Cartwright, editor, Proceedings of the Conference on Programming Language Design and Implementation, pages 177–186, New York, NY, USA, June 1993. pdf
[4] J. Barnes and P. Hut. A hierarchical O(n*log(n)) force-calculation algorithm. Nature, 324:446-449, 1986.
[5] C. Lever, and D. Boreham. Malloc() Performance in a Multithreaded Linux Environment. In USENIX Annual Technical Conference, Freenix Session. San Diego, CA. Jun. 2000. Available at https://github.com/kuszmaul/SuperMalloc/tree/master/tests
[6] Timothy Crundal. Reducing Active-False Sharing in TCMalloc. 2016. http://courses.cecs.anu.edu.au/courses/CSPROJECTS/16S1/Reports/Timothy*Crundal*Report.pdf. CS16S1 project at the Australian National University.
[7] Alexey Kukanov, and Michael J Voss. The Foundations for Scalable Multi-Core Software in Intel Threading Building Blocks. Intel Technology Journal 11 (4). 2007
[8] Paul Liétar, Theodore Butler, Sylvan Clebsch, Sophia Drossopoulou, Juliana Franco, Matthew J Parkinson, Alex Shamis, Christoph M Wintersteiger, and David Chisnall. Snmalloc: A Message Passing Allocator. In Proceedings of the 2019 ACM SIGPLAN International Symposium on Memory Management, 122–135. ACM. 2019.
C
84.4%
C++
7.4%
Shell
6.4%
Suite for benchmarking malloc implementations.
513
stars
474
commits
C
primary language
Sep 2, 2026
updated
Suite for benchmarking malloc implementations, originally
developed for benchmarking mimalloc.
Collection of various benchmarks from the academic literature, together with
automated scripts to pull specific versions of benchmark programs and
allocators from Github and build them.
Due to the large variance in programs and allocators, the suite is currently
only developed for Unix-like systems, and specifically Ubuntu with apt-get, Fedora with dnf,
and macOS (for a limited set of allocators and benchmarks).
The only system-installed allocator used is glibc's implementation that ships as part of Linux's libc.
All other allocators are downloaded and built as part of build-bench-env.sh --
if you are looking to run these benchmarks on a different Linux distribution look at
the setup_packages function to see the packages required to build the full set of
allocators.
It is quite easy to add new benchmarks and allocator implementations -- please do so!.
Enjoy, Daan
Note that all the code in the bench directory is not part of
mimalloc-bench as such, and all programs in the bench directory are
governed under their own specific licenses and copyrights as detailed in
their README.md (or license.txt) files. They are just included here for convenience.
The build-bench-env.sh script with the all argument will automatically pull
all needed benchmarks and allocators and build them in the extern directory:
~/dev/mimalloc-bench> ./build-bench-env.sh all
It starts installing packages and you will need to enter the sudo password.
All other programs are build in the mimalloc-bench/extern directory.
Use ./build-bench-env.sh -h to see all options.
If everything succeeded, you can run the full benchmark suite (from out/bench) as:
~/dev/mimalloc-bench> cd out/bench~/dev/mimalloc-bench/out/bench>../../bench.sh alla alltOr just test mimalloc and tcmalloc on cfrac and larson with 16 threads:
~/dev/mimalloc-bench/out/bench>../../bench.sh --procs=16 mi tc cfrac larsonGenerally, you can specify the allocators (mi, je,
tc, hd, sys (system allocator)) etc, and the benchmarks
, cfrac, espresso, barnes, lean, larson, alloc-test, cscratch, etc.
Or all allocators (alla) and tests (allt).
Use --procs=<n> to set the concurrency, and use --help to see all supported
allocators and benchmarks.
Supported allocators are as follow, see build-bench-env.sh for the versions:
The first set of benchmarks are real world programs, or are trying to mimic some, and consists of:
cfrac and espresso but is multithreaded../lean --make -j N). Big real-world workload with intensive
allocations.The second set of benchmarks are stress tests and consist of:
94f6cb
(master, 2018-07-04)Finally, there is a security benchmark aiming at checking basic security properties of allocators.
Below is an example (Apr 2019) of the benchmark results on an HP Z4-G4 workstation with a 4-core Intel® Xeon® W2123 at 3.6 GHz with 16GB ECC memory, running Ubuntu 18.04.1 with LibC 2.27 and GCC 7.3.0.
Memory usage:
(note: the xmalloc-testN memory usage should be disregarded is it allocates more the faster the program runs. Unfortunately, there are no entries for SuperMalloc in the leanN and xmalloc-testN benchmarks as it faulted on those)
[1] Emery D. Berger, Kathryn S. McKinley, Robert D. Blumofe, and Paul R. Wilson. Hoard: A Scalable Memory Allocator for Multithreaded Applications the Ninth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-IX). Cambridge, MA, November 2000. pdf
[2] P. Larson and M. Krishnan. Memory allocation for long-running server applications. In ISMM, Vancouver, B.C., Canada, 1998. pdf
[3] D. Grunwald, B. Zorn, and R. Henderson. Improving the cache locality of memory allocation. In R. Cartwright, editor, Proceedings of the Conference on Programming Language Design and Implementation, pages 177–186, New York, NY, USA, June 1993. pdf
[4] J. Barnes and P. Hut. A hierarchical O(n*log(n)) force-calculation algorithm. Nature, 324:446-449, 1986.
[5] C. Lever, and D. Boreham. Malloc() Performance in a Multithreaded Linux Environment. In USENIX Annual Technical Conference, Freenix Session. San Diego, CA. Jun. 2000. Available at https://github.com/kuszmaul/SuperMalloc/tree/master/tests
[6] Timothy Crundal. Reducing Active-False Sharing in TCMalloc. 2016. http://courses.cecs.anu.edu.au/courses/CSPROJECTS/16S1/Reports/Timothy*Crundal*Report.pdf. CS16S1 project at the Australian National University.
[7] Alexey Kukanov, and Michael J Voss. The Foundations for Scalable Multi-Core Software in Intel Threading Building Blocks. Intel Technology Journal 11 (4). 2007
[8] Paul Liétar, Theodore Butler, Sylvan Clebsch, Sophia Drossopoulou, Juliana Franco, Matthew J Parkinson, Alex Shamis, Christoph M Wintersteiger, and David Chisnall. Snmalloc: A Message Passing Allocator. In Proceedings of the 2019 ACM SIGPLAN International Symposium on Memory Management, 122–135. ACM. 2019.
C
84.4%
C++
7.4%
Shell
6.4%