{"id":13629749,"url":"https://github.com/emeryberger/Hoard","last_synced_at":"2025-04-17T09:36:14.352Z","repository":{"id":2921016,"uuid":"3931380","full_name":"emeryberger/Hoard","owner":"emeryberger","description":"The Hoard Memory Allocator: A Fast, Scalable, and Memory-efficient Malloc for Linux, Windows, and Mac.","archived":false,"fork":false,"pushed_at":"2024-08-02T23:20:42.000Z","size":830,"stargazers_count":1097,"open_issues_count":11,"forks_count":128,"subscribers_count":64,"default_branch":"master","last_synced_at":"2024-10-29T15:36:06.964Z","etag":null,"topics":["malloc","memory-allocation","memory-manager"],"latest_commit_sha":null,"homepage":"http://www.hoard.org","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emeryberger.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"emeryberger"}},"created_at":"2012-04-04T17:47:15.000Z","updated_at":"2024-10-27T14:55:43.000Z","dependencies_parsed_at":"2024-01-03T01:19:53.128Z","dependency_job_id":"6e57d5fe-0a15-412c-9fa7-727efee9f97f","html_url":"https://github.com/emeryberger/Hoard","commit_stats":{"total_commits":513,"total_committers":13,"mean_commits":39.46153846153846,"dds":"0.27095516569200784","last_synced_commit":"818d777dc9055be611684e650925a53eb3bd0b8a"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeryberger%2FHoard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeryberger%2FHoard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeryberger%2FHoard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeryberger%2FHoard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emeryberger","download_url":"https://codeload.github.com/emeryberger/Hoard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223751449,"owners_count":17196642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["malloc","memory-allocation","memory-manager"],"created_at":"2024-08-01T22:01:18.262Z","updated_at":"2024-11-08T20:32:00.349Z","avatar_url":"https://github.com/emeryberger.png","language":"C++","readme":"\n[The Hoard Memory Allocator](http://www.hoard.org)\n--------------------------\n\nby [Emery Berger](http://www.emeryberger.org)\n\nThe Hoard memory allocator is a fast, scalable, and memory-efficient\nmemory allocator that works on a range of platforms, including Linux,\nMac OS X, and Windows.\n\nHoard is a drop-in replacement for malloc that can dramatically\nimprove application performance, especially for multithreaded programs\nrunning on multiprocessors and multicore CPUs. No source code changes\nnecessary: just link it in or set one environment variable (see\n[Building Hoard](#building-hoard-unixmac), below).\n\n![Downloads](https://img.shields.io/github/downloads/emeryberger/Hoard/total)\n\nPress\n-----\n\n*   \"If you'll be running on multiprocessor machines, ... use Emery\nBerger's excellent Hoard multiprocessor memory management code. It's a\ndrop-in replacement for the C and C++ memory routines and is very fast\non multiprocessor machines.\"\n\n    * [Debugging Applications for Microsoft .NET and Microsoft Windows, Microsoft Press](http://www.microsoft.com/mspress/books/5822.aspx)\n\n*   \"(To improve scalability), consider an open source alternative such as\nthe Hoard Memory Manager...\"\n\n    * [Windows System Programming, Addison-Wesley](http://www.amazon.com/Windows-Programming-Addison-Wesley-Microsoft-Technology/dp/0321657748/)\n\n*   \"Hoard dramatically improves program performance through its more\nefficient use of memory. Moreover, Hoard has provably bounded memory\nblowup and low synchronization costs.\"\n\n    * [Principles of Parallel Programming, Addison-Wesley](http://www.amazon.com/Principles-Parallel-Programming-Calvin-Lin/dp/0321487907/)\n\nUsers\n-----\n\nCompanies using Hoard in their products and servers include AOL,\nBritish Telecom, Blue Vector, Business Objects (formerly Crystal\nDecisions), Cisco, Credit Suisse, Entrust, InfoVista, Kamakura,\nNovell, Oktal SE, OpenText, OpenWave Systems (for their Typhoon and\nTwister servers), Pervasive Software, Plath GmbH, Quest Software,\nReuters, Royal Bank of Canada, SAP, Sonus Networks, Tata\nCommunications, and Verite Group.\n\nOpen source projects using Hoard include the Asterisk Open Source\nTelephony Project, Bayonne GNU telephony server, the Cilk parallel\nprogramming language, the GNU Common C++ system, the OpenFOAM\ncomputational fluid dynamics toolkit, and the SafeSquid web proxy.\n\nHoard is now a standard compiler option for the Standard Performance\nEvaluation Corporation's CPU2006 benchmark suite for the Intel and\nOpen64 compilers.\n\nLicensing\n---------\n\nHoard has now been released under the widely-used and permissive\nApache license, version 2.0.\n\n\nWhy Hoard?\n----------\n\nThere are a number of problems with existing memory allocators that\nmake Hoard a better choice.\n\n### Contention ###\n\n\nMultithreaded programs often do not scale because the heap is a\nbottleneck. When multiple threads simultaneously allocate or\ndeallocate memory from the allocator, the allocator will serialize\nthem. Programs making intensive use of the allocator actually slow\ndown as the number of processors increases. Your program may be\nallocation-intensive without you realizing it, for instance, if your\nprogram makes many calls to the C++ Standard Template Library (STL). Hoard eliminates this bottleneck.\n\n### False Sharing ###\n\nSystem-provided memory allocators can cause insidious problems for multithreaded code. They can\nlead to a phenomenon known as \"false sharing\": threads on different CPUs\ncan end up with memory in the same cache line, or chunk of\nmemory. Accessing these falsely-shared cache lines is hundreds of\ntimes slower than accessing unshared cache lines. Hoard is designed to prevent false sharing.\n\n### Blowup ###\n\nMultithreaded programs can also lead the allocator to blowup memory\nconsumption. This effect can multiply the amount of memory needed to\nrun your application by the number of CPUs on your machine: four CPUs\ncould mean that you need four times as much memory. Hoard is guaranteed (provably!) to bound memory consumption.\n\n\n## Installation\n\n### Homebrew (Mac OS X)\n\nYou can use Homebrew to install the current version of Hoard as follows:\n\n    brew tap emeryberger/hoard\n    brew install --HEAD emeryberger/hoard/libhoard\n\nThis not only installs the Hoard library, but also creates a `hoard` command you can use to run Hoard with anything at the command-line.\n\n    hoard myprogram-goes-here\n\n-------------------------\n### Building Hoard from source (Mac OS X, Linux, and Windows WSL2)\n\nOn Linux, you may need to first install the appropriate version of `libstdc++-dev` (e.g., `libstdc++-12-dev`):\n\n```bash\n   sudo apt install libstdc++-dev\n```\n\nNow, to build Hoard from source, do the following:\n\n```bash\n    git clone https://github.com/emeryberger/Hoard\n    cd src\n    make\n```\n\nYou can then use Hoard by linking it with your executable, or\nby setting the `LD_PRELOAD` environment variable, as in\n\n```bash\n    export LD_PRELOAD=/path/to/libhoard.so\n```\n\nor, in Mac OS X:\n\n```bash\n    export DYLD_INSERT_LIBRARIES=/path/to/libhoard.dylib\n```\n------------------------\n### Building Hoard (Windows)\n\nChange into the `src` directory and build the Windows version:\n\n    C:\\hoard\\src\u003e nmake\n\nTo use Hoard, link your executable with `source\\uselibhoard.cpp` and `libhoard.lib`.\nYou *must* use the `/MD` flag.\n\nExample:\n\n    C:\\hoard\\src\u003e cl /Ox /MD yourapp.cpp source\\uselibhoard.cpp libhoard.lib\n\nTo run `yourapp.exe`, you will need to have `libhoard.dll` in your path.\n\nBenchmarks\n----------\n\nThe directory `benchmarks/` contains a number of benchmarks used to\nevaluate and tune Hoard.\n\n\nTechnical Information\n---------------------\n\nHoard has changed quite a bit over the years, but for technical details of the first version of Hoard, read [Hoard: A\nScalable Memory Allocator for Multithreaded Applications](http://dl.acm.org/citation.cfm?id=379232),\nby Emery D. Berger, Kathryn S. McKinley, Robert D. Blumofe, and Paul\nR. Wilson. The Ninth International Conference on Architectural Support\nfor Programming Languages and Operating Systems\n(ASPLOS-IX). Cambridge, MA, November 2000.\n\n","funding_links":["https://github.com/sponsors/emeryberger"],"categories":["Memory Allocation","Software","C++","C++ (70)","内存分配"],"sub_categories":["Trends","数学"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femeryberger%2FHoard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femeryberger%2FHoard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femeryberger%2FHoard/lists"}