~/talk

Go Tune Your Memory

Talkat dotGo 2019 · on Monday, 2019-03-25· [go]
slides:none on file

Go exposes one tunable: the GOGC environment variable that sets allowed heap growth relative to the last GC and defaults to GOGC=100. Setting GOGC=50 forces GC roughly twice as often and shrinks working set, useful when a service holds a 20 GB stable dataset. Setting GOGC=400 reduces GC frequency and CPU, cutting latency in one proxy case by ~30%. For short lived processes the option GOGC=off can speed up runs by ~20–30% (observed with Go 1.12 and Prometheus heap metrics).

AI-written summary · about

  1. 0:00Intro
  2. 0:51Why care about Garbage?
  3. 1:56Stack vs Heap
  4. 3:11GC Tuning Options
  5. 3:30Go GC Options
  6. 5:03The Go heap.
  7. 5:38Allocate some more memory
  8. 5:58Garbage-Collect!
  9. 6:25Allocate more memory
  10. 7:56Garbage collect!
  11. 11:24Chart it!
  12. 12:48Situation: large stable data set
  13. 15:08Situation: small heap, very rapid GC
  14. 17:22What if we turn off GC completely?
  15. 18:22Try it out!
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.