Daily Archives: 21.07.2019

How golang garbage collection works

It is a Mark-and-Sweep GC. Phases: Mark Stop-the-World: Set write barrier (to know how much was allocated during maark phase) Concurrent: Mark all memory which is still in use by the app Stop-the-World: Remove write barrier Concurrent: Sweep (it actually happens on new allocations) Video from Bill Kennedy (very basic; great explanation of gc trace): …

Read more