Tagged articles
3 articles
Page 1 of 1
IT Services Circle
IT Services Circle
Dec 22, 2025 · Fundamentals

How Go’s Runtime Manages Memory: From Kernel SLAB to mheap and mcache

This article explains Go's memory allocator by comparing it with the Linux kernel SLAB allocator, detailing the page‑heap (mheap), span structures, per‑P caches (mcache), and the mallocgc path for small and large allocations, while showing key source code snippets and diagrams.

GoMemory ManagementRuntime
0 likes · 18 min read
How Go’s Runtime Manages Memory: From Kernel SLAB to mheap and mcache
Java Architecture Stack
Java Architecture Stack
Nov 18, 2024 · Fundamentals

Inside Go’s Runtime: How mcache and mheap Manage Memory

This article provides a detailed technical analysis of Go's runtime memory management, covering the initialization of the mheap structure, small‑object allocation via mcache, large‑object handling, the three‑color mark‑and‑sweep garbage collector, memory release mechanisms, and the optimization techniques that coordinate mcache and mheap for efficient concurrent execution.

Garbage CollectionGoMemory Management
0 likes · 12 min read
Inside Go’s Runtime: How mcache and mheap Manage Memory