Skip to content
All writing Part 11 of 11 · From 19 Goroutines to Exit 137
Engineering · 3 min read

The Wrong Fix: GOMEMLIMIT on the Wrong Process, and Git Archeology

fix-locus ≠ failure-locus means the fix does nothing. GOMEMLIMIT on the Go heap can't stop a browser OOM, and git archeology reveals why it broke now.

fix-locus (where you fix) ≠ failure-locus (where it breaks) → the fix does nothing.

Wrong Process

Go app container heap: 256Mi GOMEMLIMIT set here Browser sidecar mem limit: 2Gi 19 tabs → OOM → exit 137 ✗ can't see Browser's memory ✗ GOMEMLIMIT doesn't reach fix-locus ≠ failure-locus → fix is inert
  • Confirm fix-locus == failure-locus: same process, same resource the kernel is killing. A control that looks on-topic can be completely orthogonal.
  • GOMEMLIMIT governs the Go heap only, not cgo, mmap, stacks, or other processes (runtime environment).
  • Red flag: a commit titled “fix OOM” that tunes a different process than the one being killed.

Git Archeology: Why Didn’t This Happen Before?

2025-01 ExecAllocator (per-request browser) blast radius: 1 request commit A → RemoteAllocator (shared browser) blast radius: ALL in-flight commit B → retry re-added multiplier on shared browser commit C → "fix OOM" → GOMEMLIMIT on Go heap ✗ wrong process 2026-07 OOM incident (exit 137)
  • The bug is “new” but the code never had protection. The real question is “what changed the conditions.” git log answers that.
  • Look for architecture swaps (isolated → shared), retry changes (multipliers), resource-limit edits (wrong target).
  • chore: / refactor: commits can silently flip a failure mode. Diff the mechanism, not the ticket title.

Lessons

  1. Before fixing, confirm the thing you’re fixing and the thing that’s dying are the same process.
  2. “It never happened before” → git log --since=<date> --reverse -- <hot-file> to find what changed the conditions.
  3. Look for prior “fix attempts”. They reveal the team’s mental model, and sometimes reveal the model was wrong.

The most dangerous fix is “looks related, actually orthogonal”. It passes code review without question and does nothing when the OOM hits.

References:

Related: see shared resource blast radius and runtime environment, or go back to the series overview.

Tags #go #concurrency #reliability
// connect

Be brave | Be wise | Be grateful

21 BreakinCode

// elsewhere
LinkedInMedium (lang: en)Life RecordYoutube
wh:~$William Hung· © 2026 Taipei · GMT+8 · Available for collaboration