The GOGC runtime variable is used to trigger a garbage collection cycle; when the heap grows a certain size relative to the heap size at end of last garbage collection cycle.

  • GOGC=100 will mean that the garbage collection cycle will start when the heap grows twice the size relative to the size it was at the end of last cycle
  • GOGC=50 will mean the garbage collector is triggered when heap grows 1.5 times of heap size at the end of last garbage collection cycle