Runtime Core
Scheduler
- paper/work-steal Robert D. Blumofe and Charles E. Leiserson. 1999. Scheduling multithreaded computations by work stealing. J. ACM 46, 5 (September 1999), 720-748.
- cl/sched-m-1 Russ Cox, Clean up scheduler. Aug 5, 2008.
- cl/sched-m-n things are much better now, Nov 11, 2009.
- design/go11sched Dmitry Vyukov. Scalable Go Scheduler Design Doc, 2012
- cl/7314062 runtime: improved scheduler
- design/sched-preempt-dmitry Dmitry Vyukov. Go Preemptive Scheduler Design Doc, 2013
- design/sched-numa Dmitry Vyukov, NUMA-aware scheduler for Go. Sep 2014.
- design/go15gomaxprocs Russ Cox. Go 1.5 GOMAXPROCS Default. May 2015.
- issue/73193 runtime: CPU limit-aware GOMAXPROCS default (container/cgroup-aware, Go 1.25)
- issue/33803 runtime: make GOMAXPROCS cfs-aware on GOOS=linux
- doc/go17sched Ian Lance Taylor. How does the golang scheduler work? July 16, 2016.
- design/sched-preempt-austin Austin Clements. Proposal: Non-cooperative goroutine preemption. Jan 2019.
- cl/43050 cmd/compile: loop preemption with fault branch on amd64. May 09, 2019.
- issue/10958 runtime: tight loops should be preemptible
- issue/24543 runtime: non-cooperative goroutine preemption
- issue/36365 runtime: clean up async preemption loose ends
- issue/14592 runtime: let idle OS threads exit
- issue/18237 runtime: scheduler is slow when goroutines are frequently woken
- issue/20395 runtime: terminate locked OS thread if its goroutine exits
- issue/20458 proposal: runtime: pair LockOSThread, UnlockOSThread calls
- issue/21827 runtime: big performance penalty with runtime.LockOSThread
- issue/27345 runtime: use parent goroutine's stack for new goroutines
- issue/28808 runtime: scheduler work stealing slow for high GOMAXPROCS
- issue/32113 runtime: optimization to reduce P churn.
- issue/43997 runtime: non-spinning Ms spin uselessly when work exists
- issue/44313 runtime: stopped Ms can't become dedicated or fractional GC workers
- issue/51071 runtime: investigate possible Go scheduler improvements inspired by Linux Kernel's CFS
- discuss/periodic-task-when-time Periodic task when time.Ticker and time.Sleep are pretty expensive (golang-nuts)
- discuss/why-there-is-a Why there is a so great performance penalty when the usage combines LockOSThread and channel? (golang-nuts)
- design/mutex-spinbit Rhys Hiltner. Proposal: Improve scalability of runtime.lock2. 2024-10-16.
- issue/61015 runtime: change mutex profile to scale contention by number of blocked goroutines
- discuss/runtime-setting-gomaxprocs-in runtime: Setting GOMAXPROCS in over-scheduled Contanier Environments (golang-nuts)
- discuss/concurrency-and-task-scheduler Concurrency and task scheduler scalability (golang-nuts)
- issue/69687 testing/synctest: experimental package for testing concurrent code
- issue/45435 sync: add Mutex.TryLock
- issue/63796 sync: add WaitGroup.Go
- issue/61696 sync: add Map.Clear method
- design/goroutine-leak-detection-gc Georgian-Vlad Saioc, Milind Chabbi. Proposal: Goroutine leak detection via garbage collection. 14 Aug 2025.
- issue/74609 runtime/pprof,runtime: new goroutine leak profile
- issue/38651 runtime: add 'created by goroutine number' to stack traces
- issue/543 runtime: preemptive scheduling
- issue/68578 runtime: improve scaling of lock2
- issue/66999 runtime: correct attribution of internal mutex contention
- issue/57071 runtime/metrics: add a way to measure runtime-internal lock contention
- issue/49881 runtime/metrics: add contention metrics
- issue/81657 runtime: speed up GC phase transitions
- issue/65694 runtime: stronger affinity between G ↔ P ↔ M ↔ CPU?
- issue/53789 runtime: express lock rank graph as a DAG like go/build/deps_test.go
- issue/13759 proposal: Add a Partial Deadlock Detector For Go
- issue/21678 runtime: provide a mechanism for debuggers to execute a function in the program being debugged
- issue/70089 proposal: runtime/mainthread: add mainthread.Do for mediating access to the main thread
- doc/container-aware-gomaxprocs Michael Pratt and Carlos Amedee. Container-aware GOMAXPROCS. August 20, 2025.
Execution Stack
- design/contigstack Contiguous stacks
- doc/stackroots precise stack roots
- discussion/stackroots Precise garbage collection of stack roots
- issue/17007 runtime: fatal error: bad g->status in ready
- issue/18138 runtime: new goroutines can spend excessive time in morestack
- design/predict-stack-size Keith Randall. Determining a good starting stack size. 2021/08/18.
- cl/341990 runtime: predict stack sizing
- cl/345889 runtime: measure stack usage; start stacks larger if needed
- issue/26061 runtime: g0 stack.lo is sometimes too low
- discuss/proposal-shared-libraries-in Proposal: Shared libraries in Go, take 2 (+linux/amd64 implementation) (golang-nuts)
- discuss/re-patch-rfc-go Re: [PATCH] RFC: go shared libraries support (Linux/x64) (golang-nuts)
- issue/15403 internal/cpu: new package to expose processor capabilities
- issue/27218 runtime: document (and support) cpu options in GODEBUG
- issue/30439 all: remove nacl port
- issue/21865 runtime/secret: add new package
- issue/66450 crypto/subtle: add WithDataIndependentTiming
- issue/45453 all: add GOAMD64 environment variable
- issue/60905 all: add GOARM64=v8.1 and so on
- issue/36435 all: stop using non-libc system calls on OpenBSD
- issue/17490 cmd/link: use libsystem_kernel.dylib or libSystem.dylib for syscalls on macOS
- issue/58378 runtime: support unwinding logical cgo stack transitions using frame pointers
- issue/16638 runtime: use frame pointers for callers
- issue/69577 crypto/rand: use new Linux vDSO
Memory Management
Allocator
A quick history about the Go's memory allocator: Russ Cox first implements
the memory allocator based on tcmalloc for Go 1, mcache is cached on M.
Then he revised the allocator to allow user code to use 16GB memory and later allows 128GB.
However, the allocator (including scavenger) was suffered from massive lock contentions and
does not scale. After Dmitry's scalable runtime scheduler, the allocator can allocate directly
from P (with much less) lock contentions. In the meantime, the scavenger is migrated from
an independent thread into the system monitor thread. Now, Michael is actively working on
improving the memory allocator's scalability, such as migrating scavenger
to user threads, bitmap-based page allocator, scalable mcentral.
- doc/tcmalloc Sanjay Ghemawat, Paul Menage. TCMalloc : Thread-Caching Malloc. Google Inc., 2009
- design/go113scavenge Michael Knyszek. Proposal: Smarter Scavenging. 2019-05-09.
- issue/30333 runtime: smarter scavenging
- issue/32012 runtime: background scavenger is overzealous with small heaps
- issue/31966 runtime: background scavenger can delay deadlock detection significantly
- issue/34047 runtime: potential deadlock cycle caused by scavenge.lock
- issue/34048 runtime: scavenger pacing fails to account for fragmentation
- issue/35788 runtime: scavenger not as effective as in previous releases
- issue/36521 runtime: performance degradation in go 1.12
- issue/36603 runtime: sysUsed often called on non-scavenged memory
- design/go114pagealloc Michael Knyszek, Austin Clements. Proposal: Scaling the Go page allocator. 2019-10-18.
- issue/35112 runtime: make the page allocator scale
- cl/200439 runtime: place lower limit on trigger ratio
- issue/8885 runtime: consider adding 24-byte size class.
- issue/37487 runtime: improve mcentral scalability
- cl/221182 runtime: add new mcentral implementation
- issue/18155 runtime: latency in sweep assists when there's no garbage
- issue/19112 runtime: deadlock involving gcControllerState.enlistWorker
- issue/23687 runtime: use MADV_FREE on linux as well
- cl/135395 runtime: use MADV_FREE on Linux if available
- issue/29707 cmd/trace: failed to parse trace: no consistent ordering of events possible
- issue/35954 runtime: handle hitting the top of the address space in the allocator more gracefully
- issue/37927 runtime: GC pacing exhibits strange behavior with a low GOGC
- issue/38130 runtime: incorrect sanity checks in the page allocator
- issue/38404 runtime: STW GC stops working on arm64/mips64le
- issue/38605 runtime: pageAlloc.allocToCache updates pageAlloc.searchAddr in an invalid way
- issue/38617 runtime: scavenger freezes up in Go 1.14 in Windows due to coarse time granularity
- issue/38966 runtime: aix-ppc64 builder is failing with "bad prune", "addr range base and limit are not in the same memory segment" fatal errors
- issue/39128 runtime: linux-mips-rtrk builder consistently failing with "bad prune" as of CL 233497
- issue/40191 runtime: pageAlloc.searchAddr may point to unmapped memory in discontiguous heaps, violating its invariant
- issue/40457 runtime: runqputbatch does not protect its call to globrunqputbatch
- issue/40641 runtime: race between stack shrinking and channel send/recv leads to bad sudog values
- issue/42330 runtime: default to MADV_DONTNEED on Linux
- cl/267100 runtime: default to MADV_DONTNEED on Linux
- issue/46787 runtime: provide Pinner API for object pinning
- issue/51317 proposal: arena: new package providing memory arenas
- issue/59960 runtime: improve heap hugepage utilization
- issue/62483 unique: new package with unique.Handle
- repo/unsafe-assuming-no-moving-gc go4.org/unsafe/assume-no-moving-gc
- cl/498121 runtime: add heapObjectsCanMove
- cl/498261 runtime: change heapObjectsCanMove to a func
- design/scaling-the-page-allocator Michael Knyszek, Austin Clements. Proposal: Scaling the Go page allocator. 2019-10-18.
- design/smarter-scavenging Michael Knyszek. Proposal: Smarter Scavenging.
- design/heap-hugepage-util Michael Knyszek, Michael Pratt. A more hugepage-aware Go heap.
- design/memory-regions Memory regions.
- discuss/70257 memory regions
- design/runtime-freegc Directly freeing user memory to reduce GC work.
- discuss/a-safe-free-of a safe free of memory proposal, runtime.FreeMemory() (golang-nuts)
- issue/10460 runtime: 512GB memory limitation
- issue/79286 runtime: sizespecializedmalloc experiment
- issue/40431 proposal: runtime.Pin() to protect against hypothetical moving GC in the future
- issue/69327 runtime: non-preemptible zeroing in clear, append, bytes.growSlice, etc
- design/go-pmem Jerrin Shaji George, Mohit Verma, Rajesh Venkatasubramanian, Pratap Subrahmanyam. Proposal: Add support for Persistent Memory in Go. January 20, 2021.
- issue/43810 proposal: spec: add native support for programming persistent memory in Go (declined)
- doc/unique Michael Knyszek. New unique package. August 27, 2024.
- doc/size-specialized-allocations Michael Matloob. Size-Specialized Memory Allocation. September 16, 2026.
Collector
- paper/on-the-fly-gc Edsger W. Dijkstra, Leslie Lamport, A. J. Martin, C. S. Scholten, and E. F. M. Steffens. 1978. On-the-fly garbage collection: An exercise in cooperation. Commun. ACM 21, 11 (November 1978), 966–975.
- paper/yuasa-barrier T. Yuasa. 1990. Real-time garbage collection on general-purpose machines. J. Syst. Softw. 11, 3 (March 1990), 181-198.
- design/bettergc Dmitry Vyukov. Better GC and Memory Allocator for Go. May 20, 2013
- discuss/bettergc Better GC and Memory Allocator for Go
- design/go13gc Dmitry Vyukov. Simpler and faster GC for Go. July 16, 2014
- cl/106260045 runtime: simpler and faster GC
- design/go14gc Richard L. Hudson. Go 1.4+ Garbage Collection (GC) Plan and Roadmap. August 6, 2014.
- design/go15gcpacing Austin Clements. Go 1.5 concurrent garbage collector pacing. Mar 10, 2015.
- discuss/gcpacing Austin Clements et al. Discussion of "Proposal: Garbage collector pacing". March 10, 2015.
- issue/11970 runtime: replace GC coordinator with state machine
- design/sweep-free-alloc Austin Clements. Proposal: Dense mark bits and sweep-free allocation. Sep 30, 2015.
- issue/12800 runtime: replace free list with direct bitmap allocation
- design/decentralized-gc Austin Clements. Proposal: Decentralized GC coordination. October 25, 2015.
- issue/12967 runtime: shrinkstack during mark termination significantly increases GC STW time
- issue/14951 runtime: mutator assists are over-aggressive, especially at high GOGC
- design/eliminate-rescan Austin Clements, Rick Hudson. Eliminate STW stack re-scanning. October 21, 2016.
- issue/17503 runtime: eliminate stack rescanning
- design/concurrent-rescan Austin Clements, Rick Hudson. Proposal: Concurrent stack re-scanning. Oct 18, 2016.
- issue/17505 runtime: perform concurrent stack re-scanning
- design/soft-heap-limit Austin Clements. Proposal: Separate soft and hard heap size goal. October 21, 2017.
- issue/22460 runtime: optimize write barrier
- design/roc Request Oriented Collector (ROC) Algorithm
- cl/roc runtime: ROC write barrier code
- cl/generational-gc runtime: trigger generational GC
- doc/ismm-gc Rick Hudson. Getting to Go: The Journey of Go's Garbage Collector. 12 July 2018.
- discuss/ismm-gc Garbage Collection Slides and Transcript now available
- design/simplify-mark-termination Austin Clements. Proposal: Simplify mark termination and eliminate mark 2. Aug 9, 2018.
- issue/26903 runtime: simplify mark termination and eliminate mark 2
- design/gcscan Proposal: GC scanning of stacks
- issue/22350 cmd/compile: compiler can unexpectedly preserve memory,
- issue/27993 runtime: error message: P has cached GC work at end of mark termination
- issue/37116 runtime: 10ms-26ms latency from GC in go1.14rc1, possibly due to 'GC (idle)' work
- issue/42430 runtime: GC pacer problems meta-issue
- issue/39983 runtime: idle GC interferes with auto-scaling
- issue/17969 runtime: aggressive GC completion is disruptive to co-tenants
- issue/14812 runtime: GC causes latency spikes
- issue/40460 runtime: goroutines may allocate beyond the hard heap goal
- issue/29696 proposal: runtime: add way for applications to respond to GC backpressure
- issue/23044 proposal: runtime: add a mechanism for specifying a minimum target heap size
- issue/42642 runtime: multi-ms sweep termination pauses (second edition)
- issue/44163 runtime: remove idle GC workers
- issue/44167 runtime: GC pacer redesign
- design/gc-pacer-redesign GC Pacer Redesign
- issue/44309 proposal: runtime/debug: user-configurable memory target
- issue/48409 proposal: runtime/debug: soft memory limit
- design/user-configurable-memory-target User-configurable memory target
- design/soft-memory-limit Soft memory limit
- issue/45894 runtime: mark termination is slow to restart mutator
- issue/45315 runtime: runtime.GC can return without finishing sweep
- issue/49075 runtime: possible memory corruption
- issue/52433 runtime: heap goal overrun due to scheduler delays in mark termination
- doc/gc-guide A Guide to the Go Garbage Collector
- issue/12234 runtime: revisit non-constant assist ratio
- issue/27732 runtime: mark assist blocks GC microbenchmark for 7ms
- design/batch-wb Keith Randall. Batching Write Barriers. 2022 Oct, 25.
- issue/31222 runtime: long pauses STW (sweep termination) on massive block allocation
- doc/greenteagc Michael Knyszek and Austin Clements. The Green Tea Garbage Collector. October 29, 2025. (experimental in Go 1.25, default in Go 1.26)
- issue/73581 runtime: green tea garbage collector
- discuss/sub-millisecond-gc-pauses Sub-millisecond GC pauses (golang-dev)
- issue/67535 runtime: add AddCleanup
- issue/71825 runtime: allow cleanups to run concurrently
- issue/67552 weak: new package providing weak pointers
- discuss/secure-go-binaries Secure Go binaries (golang-nuts)
- issue/11911 runtime: unbounded heap growth with concurrent GC
- issue/12041 runtime: redesign GC synchronization
- issue/27583 runtime: feature request: Support for ASLR with the heap
- doc/go119runtime Michael Knyszek. Go runtime: 4 years later. September 26, 2022.
- doc/cleanups-and-weak Michael Knyszek. From unique to cleanups and weak: new low-level tools for efficiency. March 6, 2025.
- talk/madhav2022 Madhav Jivrajani. Control Theory and Concurrent Garbage Collection Deep Dive. GopherCon 2022, Chicago. October 2022.
- talk/tarun2022 Tarun Pothulapati. Soft Memory Limit in Go 1.19. Lightning talk, GopherCon 2022, Chicago. October 2022.
- talk/yifei2023 Yifei Zhang. Balanced GC: A Copying Garbage Collector for Golang. GopherCon 2023, San Diego. September 2023.
Statistics
- issue/16843 runtime: mechanism for monitoring heap size
- cl/setmaxheap Austin Clements. runtime/debug: add SetMaxHeap API. Jun 26 2017.
- design/go116runtime-metric Michael Knyszek. Proposal: API for unstable runtime metrics. Mar 18, 2020.
- issue/19812 runtime: cannot ReadMemStats during GC
- issue/38712 runtime: TestMemStats is flaky
- issue/40459 runtime: ReadMemStats called in a loop may prevent GC
- issue/50285 proposal: runtime/metrics: define a recommended set of metrics
- issue/15490 runtime/metrics: add goroutine state counts, total goroutines created, total threads
- design/go-runtime-stats Go runtime stats.
- issue/37112 runtime: API for unstable metrics
- issue/47216 runtime/metrics: add GOMAXPROCS, NumCgoCall, GC CPU time
- issue/56857 runtime/metrics: add /gc/heap/live:bytes
- design/memlimits Memory Limits for Go (Public). Proposed in issue/16843.
Memory model
The Go memory model consists the following parts:
-
Memory order regarding atomic operations
-
Memory order regarding the
syncpackage APIs -
Memory order regarding runtime mechanism (i.e. Object finalizer)
-
doc/refmem Rob Pike and Russ Cox. The Go Memory Model. February 21, 2009.
-
issue/4947 cmd/cc: atomic intrinsics
-
issue/5045 doc: define how sync/atomic interacts with memory model
-
issue/7948 doc: define how sync interacts with memory model
-
issue/9442 doc: define how finalizers interact with memory model
-
issue/33815 doc/go_mem: "hello, world" will not always be printed twice
-
cl/75130045 doc: allow buffered channel as semaphore without initialization
-
doc/gomem Russ Cox. Go’s Memory Model. February 25, 2016.
-
doc/go2017russ Russ Cox. My Go Resolutions for 2017: Memory model. January 18, 2017.
-
doc/atomic-bug Package atomic
-
discuss/atomic-mem-order specify the memory order guarantee provided by atomic Load/Store
-
issue/37355 runtime/race: running with -race misses races (mismatch with memory model)
- cl/220419 runtime: swap the order of raceacquire() and racerelease
- issue/42598 runtime: apparent false-positive race report for a buffered channel after CL 220419
- cl/271987 runtime: check channel's elemsize before calling race detector
- [paper/fava2020fix] Fava, Daniel Schnetzer. "Finding and Fixing a Mismatch Between the Go Memory Model and Data-Race Detector." International Conference on Software Engineering and Formal Methods. Springer, Cham, 2020.
-
doc/mm Russ Cox. Memory Models. June, 2021.
- doc/hwmm Russ Cox. Hardware Memory Models. June 29, 2021.
- doc/plmm Russ Cox. Programming Language Memory Models. July 6, 2021.
- doc/gomm Russ Cox. Updating the Go Memory Model. July 12, 2021.
- discuss/47141 Updating the Go memory model.
- issue/50860 proposal: sync/atomic: add typed atomic values
- issue/50859 proposal: doc: update Go memory model
- doc/out-of-thin-air Hans-J. Boehm. P1217R2: Out-of-thin-air, revisited, again. 2019-06-16.
- doc/cpp-memory-model Hans-J. Boehm, Sarita V. Adve. Foundations of the C++ Concurrency Memory Model. May 21, 2008.
- cl/381315 doc: update Go memory model
- cl/381316 runtime, sync, sync/atomic: document happens-before guarantees
-
discuss/align-64-bit-integers align 64-bit integers on 32-bit platforms (golang-dev)
-
issue/61395 sync/atomic: add OR/AND operators for unsigned types
-
issue/53821 runtime: convert atomic values to runtime/internal/atomic types
ABI
- design/cgo-pointers Ian Lance Taylor. Proposal: Rules for passing pointers between Go and C. October, 2015
- issue/12416 cmd/cgo: specify rules for passing pointers between Go and C
- design/internal-abi Austin Clements. Proposal: Create an undefined internal calling convention. Jan 14, 2019.
- issue/27539 proposal: runtime: make the ABI undefined as a step toward changing it.
- issue/31193 cmd/compile, runtime: reduce function prologue overhead
- design/register-call Austin Clements, with input from Cherry Zhang, Michael Knyszek, Martin Möhrmann, Michael Pratt, David Chase, Keith Randall, Dan Scales, and Ian Lance Taylor. Proposal: Register-based Go calling convention. Aug 10, 2020.
- issue/18597 proposal: cmd/compile: define register-based calling convention
- issue/40724 proposal: switch to a register-based calling convention for Go functions
- design/internal-abi-spec Go internal ABI specification.
- issue/78902 simd: architecture and vector-size agnostic SIMD intrinsics under a GOEXPERIMENT
- issue/44816 cmd/compile: register ABI bringup testcase failures (tracking issue)
Misc
- issue/20135 runtime: shrink map as elements are deleted
- issue/48687 runtime: enhance map cacheline efficiency
- issue/54766 runtime: use SwissTable
- discuss/design-discuss-switch-hashmap Design discuss: Switch hashmap implementation to SipHash-2-4 (golang-dev)
- issue/14874 proposal: cmd/compile: compiler-emitted itab symbols
- issue/61716 math/rand/v2: revised API for math/rand
- discuss/60751 math/rand/v2: a new API for math/rand and a first v2 for std
- issue/16093 runtime/pprof: generate profiles in gzipped proto format
- issue/76349 runtime: add runtime/pprof goroutine labels to tracebacks
- issue/42888 runtime/debug: add SetCrashOutput(file *os.File)
- issue/37475 cmd/go: stamp git/vcs current HEAD hash/commit hash/dirty bit in binaries
- issue/67182 runtime/debug: add SetCrashOutput options
- issue/3885 runtime: profile and tune map code
- issue/25237 runtime: opportunistically rotate map key seed
- issue/2630 runtime: hash function should be randomized to prevent DOS attacks
- issue/20505 runtime: need a better itab table
- issue/75280 runtime/pprof,runtime: add new goroutine leak profile as a GOEXPERIMENT
- doc/randv2 Russ Cox. Evolving the Go Standard Library with math/rand/v2. May 1, 2024.
- doc/chacha8rand Russ Cox and Filippo Valsorda. Secure Randomness in Go 1.22. May 2, 2024.
- doc/swisstable Michael Pratt. Faster Go maps with Swiss Tables. February 26, 2025.
- doc/goroutine-leak-profiles Vlad Saioc. Goroutine Leak Profiles. September 2, 2026.