Mimalloc is a [[MIT License#Attribution]] licensed [[Memory Allocator]] written in [[3. Reference/Software/Programming Languages/C|C]] and controlled by [[Microsoft]]. - Website - [Source](https://github.com/microsoft/mimalloc) - Documentation > mimalloc (pronounced "me-malloc") is a free and open-source compact general-purpose memory allocator developed by Microsoft with focus on performance characteristics. \- Wikipedia article # Notability ## Usage Used by: - [[Microsoft]] [[Bing]] - [[Microsoft]] [[Azure]] - [[Death Stranding]] ([[Decima Game Engine]]) - [[Unreal Engine]] - [[SPAdes Genome Assembler]] - [[NoGIL Python Fork]] - https://github.com/colesbury/nogil - [[Koka]] programming language - [[Lean (Programming Language)|Lean]] (supposedly was the origin, but I see no evidence in the source by name, I suppose Mimalloc was a fork of it) ### Unreal Engine > Added mimalloc allocator from https://github.com/microsoft/mimalloc because it performs better than mimalloc in cooker benchmarks. We still default to TBB malloc until the behavior has been explored in more depth. \- commit message[^1] in private repo Presumably they meant that it performs better than [[Intel]]'s [[TBB malloc]].[^2] > This version of mimalloc is very efficient at distributing threaded allocations in a way that maintains locality which in turn improve the amount of memory that we're able to send back to the system after heavily multithreaded workloads. This also improves performance as less page fault and cache misses are expected coming from more densily packed allocations. > > mimalloc v1 seemed to waste more memory because of its commit size being larger than TBB. > > However, its allocation patterns was already way tigther than TBB but for it to become apparent, you had to activate the "page_reset" and "reset_decommits" options, which came at a performance loss. > > mimalloc v2 offers both better locality and by default will more agressively decommit memory with only minor performance loss in some cases and performance gain in many. > > Given the advantages of mimalloc v2 compared to Intel TBB, we should probably consider it as our next default allocator for the editor. \- commit message[^3] in private repo [[Unreal Engine]] switched to Mimalloc in a commit[^4] made in [[2021]] and was officially released with version `5.0`. # Philosophy A [[Microsoft]] project. # Platform Support - [[Linux]] - [[MacOS]] - [[FreeBSD]] - [[Haiku]] - [[Windows]] # Features # Tips # History > Initially developed by Daan Leijen for the runtime systems of the [[Koka]] and [[Lean (Programming Language)|Lean]] languages. # References [^1]: https://github.com/EpicGames/UnrealEngine/commit/8f0e83305e10265798a13edb809006c7d45ddc91 [^2]: https://www.intel.com/content/www/us/en/docs/onetbb/developer-guide-api-reference/2021-6/scalable-memory-allocator.html [^3]: https://github.com/EpicGames/UnrealEngine/commit/e6f54c17c42406a12ae597b7442230873982f1c0 [^4]: https://github.com/EpicGames/UnrealEngine/commit/0fc6b336263b7859be981572497721892629d747