~/talk

Heap Optimization for Go Systems

Talkat SREcon20 Americas · 2020-12-07..12-09· [go]
links:none on file
slides:none on file

GODEBUG=gctrace=1 plus runtime.MemStats and pprof heap profiles identify GC spikes and show whether p99 latency correlates with collections. Replacing string map keys with a struct of three IDs drops ~26 million heap objects (~20% reduction), field pruning and reordering shrink per-object size from 64 to 24 bytes, and object pools lower allocation bursts when safe. Focus is on memstats and pprof flame graphs, GODEBUG gctrace, concrete reductions in object counts and bytes, and choosing value vs pointer layouts to cut GC scanning.

AI-written summary · about

  1. 0:00Intro
  2. 0:46How does memory management in Go work?
  3. 2:07How does GC impact performance?
  4. 3:02What causes GC pressure?
  5. 4:38How to determine if GC is the problem? High tail latency Set the GODEBUG environment variable to see GC stats
  6. 7:17How to profile heap usage?
  7. 12:08How can we limit the impact of GC? Lower the number of objects on heap
  8. 12:41Reduce long-living heap objects
  9. 14:21Impact of removing strings
  10. 14:55Reduce the rate of allocation
  11. 15:34Clean up unused data fields
  12. 16:28Reorder fields for proper data alignment
~/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.