---
title: "How we tracked down a Go 1.24 memory regression across hundreds of pods"
description: "Upgrading a data-processing service to Go 1.24 raised container memory by about 20% even though Go runtime metrics and heap profiles stayed flat."
url: "https://swe.quest/articles/how-we-tracked-down-a-go-1-24-memory-regression-across-hundreds-of-pods-bbf00972d141a71d"
canonical: "https://www.datadoghq.com/blog/engineering/go-memory-regression/"
source: "Datadog Engineering"
published: "2025-07-17"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["go","memory-management","debugging","performance","runtimes"]
---

# How we tracked down a Go 1.24 memory regression across hundreds of pods

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2025-07-17, 9 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/go-memory-regression/](https://www.datadoghq.com/blog/engineering/go-memory-regression/)

## Summary

Upgrading a data-processing service to Go 1.24 raised container memory by about 20% even though Go runtime metrics and heap profiles stayed flat. Comparing \`/proc/\[pid\]/smaps\` showed the Go heap's RSS had grown to nearly match its virtual size. Reproducing the workload with heapbench and running \`git bisect\` traced the cause to a \`mallocgc\` refactor. That refactor dropped an optimization that skipped re-zeroing fresh OS memory for large (\>32 KiB) pointer-containing allocations, so untouched pages were committed to RAM. The fix ships in Go 1.25, and in the worst case RSS should roughly equal Go-reported virtual memory, which is useful when checking memory-limit headroom before rollout.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Go](https://swe.quest/tags/go.md) (Languages)
- [Memory management](https://swe.quest/tags/memory-management.md) (Compilers & runtimes)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)

## Prerequisites

- Go runtime memory metrics ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))
- virtual memory vs RSS
- Linux /proc filesystem ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))

## Keywords

Go 1.24, mallocgc, Swiss Tables, heapbench, smaps, git bisect

## Related posts

- [How Go 1.24’s Swiss Tables saved us hundreds of gigabytes](https://swe.quest/articles/how-go-1-24-s-swiss-tables-saved-us-hundreds-of-gigabytes-4fbf9a0f30e1e4c9.md): Datadog Engineering · 2025-07-17 · Medium · 17 min read · Go, Data structures, Memory management, Runtimes & VMs, Performance engineering
  Go 1.24's new map implementation, based on Swiss Tables and extendible hashing, cut roughly 500 MiB of live heap (about 1 GiB of RSS with GOGC=100) from a 3.5-million-entry routing cache map, enough to more than offset a separate Go 1.24 mallocgc memory regression.
- [The effect of switching to TCMalloc on RocksDB memory use](https://swe.quest/articles/the-effect-of-switching-to-tcmalloc-on-rocksdb-memory-use-97e46a9ddc75be5e.md): Cloudflare · 2021-02-03 · Medium · 8 min read · Memory management, Performance engineering, Linux, Storage engines
  Quicksilver's memory roughly doubled after its storage moved to RocksDB, climbing from about 15GB to 30GB over several days.
- [Size-Specialized Memory Allocation](https://swe.quest/articles/size-specialized-memory-allocation-cb92a01eba7d925f.md): The Go Blog · 2026-09-16 · Hard · 7 min read · Memory management, Go, Runtimes & VMs, Performance engineering
  Go 1.27 adds size-specialized variants of the runtime's mallocgc for allocations of 80 bytes or fewer, one per span class (size class plus pointer/no-pointer), making these allocations 20-30% faster and allocation-heavy programs up to 1% faster.
- [Bun v1.2.1](https://swe.quest/articles/bun-v1-2-1-aab3e8d9e0004536.md): Bun · 2025-01-27 · Medium · 7 min read · JavaScript, Runtimes & VMs, Memory management, Zig
  Bun v1.2.1 fixes 32 bugs and adds S3 storage class support, X25519 key generation in crypto.generateKeyPair, Node's --zero-fill-buffers flag, indented inline snapshots in bun test, and a bunfig option to disable minification for HTML imports.
- [May 18 Replit downtime](https://swe.quest/articles/may-18-replit-downtime-8ded63600c4e370b.md): Replit · 2023-05-20 · Medium · 4 min read · Incidents & postmortems, Go, Concurrency, Deployment, Configuration management
  A latent Go bug leaked RWMutex read-locks whenever a configuration kind had no handler.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
