Go GC Print out the information

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.