This is a creation in Article, where the information may have evolved or changed.
Environment
The go version of this article is go1.8 linux/amd64.
Start the program
Set the environment variable Godebug, and then start the program. If the program is called proc, the start command is:
GODEBUG=gctrace=1 ./proc
GC Information
The GC prints the content like this:
gc 1 @0.045s 22%: 4.6+182+0.38 ms clock, 9.2+0/96/86+0.77 ms cpu, 52->52->52 MB, 53 MB goal, 2 P
The Information format for GC printing is probably as follows:
gc # @#s #%: #+...+# ms clock, #+...+# ms cpu, #->#-># MB, # MB goal, # P
The field has the following meanings:
gc # the GC number, incremented at each GC @#s time in seconds since program start #% percentage of time spent in GC since program start #+...+# wall-clock/CPU times for the phases of the GC #->#-># MB heap size at GC start, at GC end, and live heap # MB goal goal heap size # P number of processors used
Reference:
Http://stackoverflow.com/questions/20551748/decipher-golang-garbage-collection-output