A Go library providing manual memory management and manually managed data structures via CGO for performance-critical applications.
mm-go is a Go library that provides manual memory management capabilities, allowing developers to bypass the garbage collector for performance-critical applications. It offers allocators and data structures that operate outside Go's GC, enabling fine-grained control over memory allocation and deallocation to reduce latency and overhead.
Go developers working on high-performance systems, game engines, real-time applications, or any scenario where garbage collection pauses are unacceptable and manual memory control is required.
Developers choose mm-go when they need to eliminate GC overhead in performance-sensitive Go code, offering up to 10x speed improvements for pointer-heavy workloads and providing C-like memory control without leaving the Go ecosystem.
Generic manual memory management for golang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks in the README show 5–10x speedups for data structures like linked lists and hash maps by bypassing GC overhead, especially with batch allocators reducing cgo calls.
Provides a suite of allocators including C, batch, and typed arenas, with an interface for custom implementations, allowing optimization for specific memory patterns.
Includes manually managed vectors, linked lists, hash maps, min-heaps, and strings, offering GC-free alternatives for common use cases with familiar APIs.
Offers helper functions like Alloc/Free with defer recommendations and clear ownership semantics, though responsibility remains on the developer.
Relies on cgo for allocation, which can introduce performance penalties if not batched properly and may cause issues on platforms where cgo is unsupported or tricky.
Developers must manually manage all memory, leading to risks of use-after-free, double-free, and segfaults, as emphasized in the README's warnings.
Cannot safely mix manually managed and Go GC-managed memory (e.g., slices in manual structs), restricting interoperability with existing Go code and libraries.
While README and godoc are provided, the niche nature means fewer community examples and third-party resources compared to standard Go packages.