Giter VIP home page Giter VIP logo

hoard's Introduction

Hoard: a Scalable Memory Allocator

A C implementation of the Hoard memory allocator. The implementation is located in allocators/horad_alloc.

Implementation details:

  1. pointers to super-block reference and owner heap are stored at the beginning of each super-block, so when we free a block of memory we can shift to the head of its super-block and find its owner. The whole operation takes constant time. However, this approach might lead to internal fragmentation in some scenarios. To sovle this we could store these pointers at the top of the heap, but it leads to worse spacial locality.
  2. In my implementation, one bin is reserved for completely full super-blocks, so we can avoid checking if a super-block is full when we allocate block.

Benchmark results:

This Hoard implementation is compared with the memory allocator in standard library(libc), and a pool-based subpage allocator(kheap, also called kmalloc)
result result result result result

How to run the benchmark:

  1. cd into top directory of the project, run export TOPDIR=$(pwd)
  2. run make all
  3. cd into the benchmark directory, where you can run ./runall ./ to run all benchmarks or ./runbench to run a particular benchmark. The whole benchmarking process took about 40min on my machine. Notice that you need to have at least 8 physical cores on you machine to run this benchmark.

Reference:

Berger, E. D.; McKinley, K. S.; Blumofe, R. D.; Wilson, P. R. (November 2000). Hoard: A Scalable Memory Allocator for Multithreaded Applications

hoard's People

Contributors

guoqikai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.