Soft Memory Limit in Go 1.19
summary
Go 1.19 adds a soft memory limit via GOMEMLIMIT that caps when GC runs by taking the min(gomemlimit−nonheap, GOGC target) rather than letting GOGC alone grow the heap. GOGC=100 makes the next GC target roughly double current live heap so an app at 30 MB live would get a 60 MB target; if a container limit is 60 MB the GC would otherwise arrive too late and OOM. gomemlimit is compared after subtracting non‑heap runtime overhead so GC triggers earlier to respect container limits.
AI-written summary · about
chapters (6)
related talks
01h 36mLinux Memory Management and Containers
01h 36mTutorial: Linux Memory Management and Containers
30mdrm and cgroup memory management - two great tastes
21mHeap sizing and GC tuning for Solr and friends
41mLies Programmers Believe about Memory
27mWhen Linux Memory Accounting Goes Wrong
46mHighmem deprecation planning
52mMemory footprint of a Java process
