[go] runtime: document GOMEMLIMIT in environment variables section

254 views
Skip to first unread message

Michael Pratt (Gerrit)

unread,
Jun 6, 2022, 5:33:18 PM6/6/22
to Michael Pratt, goph...@pubsubhelper.golang.org, Austin Clements, Michael Knyszek, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Michael Knyszek.

Patch set 1:Run-TryBot +1

View Change

    To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
    Gerrit-Change-Number: 410734
    Gerrit-PatchSet: 1
    Gerrit-Owner: Michael Pratt <mpr...@google.com>
    Gerrit-Reviewer: Austin Clements <aus...@google.com>
    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-Attention: Austin Clements <aus...@google.com>
    Gerrit-Attention: Michael Knyszek <mkny...@google.com>
    Gerrit-Comment-Date: Mon, 06 Jun 2022 21:33:14 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Michael Pratt (Gerrit)

    unread,
    Jun 6, 2022, 5:36:52 PM6/6/22
    to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Austin Clements, Michael Knyszek, Michael Pratt.

    Michael Pratt uploaded patch set #2 to this change.

    View Change

    The following approvals got outdated and were removed: Run-TryBot+1 by Michael Pratt

    runtime: document GOMEMLIMIT in environment variables section

    For #48409.

    Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
    ---
    M src/runtime/extern.go
    1 file changed, 24 insertions(+), 1 deletion(-)

    To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
    Gerrit-Change-Number: 410734
    Gerrit-PatchSet: 2
    Gerrit-Owner: Michael Pratt <mpr...@google.com>
    Gerrit-Reviewer: Austin Clements <aus...@google.com>
    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Austin Clements <aus...@google.com>
    Gerrit-Attention: Michael Knyszek <mkny...@google.com>
    Gerrit-Attention: Michael Pratt <mpr...@google.com>
    Gerrit-MessageType: newpatchset

    Michael Pratt (Gerrit)

    unread,
    Jun 6, 2022, 5:37:05 PM6/6/22
    to Michael Pratt, goph...@pubsubhelper.golang.org, Gopher Robot, Austin Clements, Michael Knyszek, golang-co...@googlegroups.com

    Attention is currently required from: Austin Clements, Michael Knyszek.

    Patch set 2:Run-TryBot +1

    View Change

      To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
      Gerrit-Change-Number: 410734
      Gerrit-PatchSet: 2
      Gerrit-Owner: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
      Gerrit-Comment-Date: Mon, 06 Jun 2022 21:37:02 +0000

      Chris Hines (Gerrit)

      unread,
      Jun 6, 2022, 7:00:51 PM6/6/22
      to Michael Pratt, goph...@pubsubhelper.golang.org, Gopher Robot, Austin Clements, Michael Knyszek, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Michael Knyszek, Michael Pratt.

      View Change

      5 comments:

      • Patchset:

      • File src/runtime/extern.go:

        • Patch Set #2, Line 24: The GOMEMLIMIT sets a soft memory limit for the runtime. This memory limit

          Perhaps "The GOMEMLIMIT _variable_ ..." to be consistent with the previous and next paragraphs.

        • Patch Set #2, Line 25: includes the Go heap and all other managed by the runtime, and excludes

          "... all other _memory_ managed by ..."

        • Patch Set #2, Line 26: external memory sources such as mappings of binary itself, memory managed in

          "mappings of _the_ binary itself"

        • Patch Set #2, Line 33: memory limit. See https://go.dev/pkg/runtime/debug/#SetMemoryLimit for

          Should this link and the one above for SetGCPercent use the new doc comment link syntax, or will they get updated in a separate CL?

      To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
      Gerrit-Change-Number: 410734
      Gerrit-PatchSet: 2
      Gerrit-Owner: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-CC: Chris Hines <chris....@gmail.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
      Gerrit-Attention: Michael Pratt <mpr...@google.com>
      Gerrit-Comment-Date: Mon, 06 Jun 2022 23:00:48 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Gerrit-MessageType: comment

      Michael Pratt (Gerrit)

      unread,
      Jun 7, 2022, 1:06:08 PM6/7/22
      to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Michael Knyszek, Michael Pratt.

      Michael Pratt uploaded patch set #3 to this change.

      View Change

      The following approvals got outdated and were removed: Run-TryBot+1 by Michael Pratt, TryBot-Result+1 by Gopher Robot

      runtime: document GOMEMLIMIT in environment variables section

      For #48409.

      Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
      ---
      M src/runtime/extern.go
      1 file changed, 24 insertions(+), 2 deletions(-)

      To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
      Gerrit-Change-Number: 410734
      Gerrit-PatchSet: 3
      Gerrit-Owner: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Chris Hines <chris....@gmail.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
      Gerrit-Attention: Michael Pratt <mpr...@google.com>
      Gerrit-MessageType: newpatchset

      Michael Pratt (Gerrit)

      unread,
      Jun 7, 2022, 1:06:25 PM6/7/22
      to Michael Pratt, goph...@pubsubhelper.golang.org, Russ Cox, Chris Hines, Gopher Robot, Austin Clements, Michael Knyszek, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Chris Hines, Michael Knyszek.

      Patch set 3:Run-TryBot +1

      View Change

      4 comments:

      • File src/runtime/extern.go:

        • Patch Set #2, Line 24: The GOMEMLIMIT sets a soft memory limit for the runtime. This memory limit

          Perhaps "The GOMEMLIMIT _variable_ ..." to be consistent with the previous and next paragraphs.

        • Done

        • "... all other _memory_ managed by ... […]

          Done

        • Patch Set #2, Line 26: external memory sources such as mappings of binary itself, memory managed in

          "mappings of _the_ binary itself"

        • Done

        • Should this link and the one above for SetGCPercent use the new doc comment link syntax, or will the […]

          Good call, done.

      To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
      Gerrit-Change-Number: 410734
      Gerrit-PatchSet: 3
      Gerrit-Owner: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Chris Hines <chris....@gmail.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
      Gerrit-Attention: Chris Hines <chris....@gmail.com>
      Gerrit-Comment-Date: Tue, 07 Jun 2022 17:06:18 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Chris Hines <chris....@gmail.com>
      Gerrit-MessageType: comment

      Chris Hines (Gerrit)

      unread,
      Jun 7, 2022, 1:26:40 PM6/7/22
      to Michael Pratt, goph...@pubsubhelper.golang.org, Gopher Robot, Russ Cox, Austin Clements, Michael Knyszek, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Michael Knyszek, Michael Pratt.

      Patch set 3:Code-Review +1

      View Change

        To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
        Gerrit-Change-Number: 410734
        Gerrit-PatchSet: 3
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Austin Clements <aus...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Russ Cox <r...@golang.org>
        Gerrit-Attention: Austin Clements <aus...@google.com>
        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
        Gerrit-Attention: Michael Pratt <mpr...@google.com>
        Gerrit-Comment-Date: Tue, 07 Jun 2022 17:26:36 +0000

        Michael Pratt (Gerrit)

        unread,
        Jun 7, 2022, 2:47:42 PM6/7/22
        to Michael Pratt, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Chris Hines, Gopher Robot, Russ Cox, Austin Clements, Michael Knyszek, golang-co...@googlegroups.com

        Michael Pratt submitted this change.

        View Change



        2 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: src/runtime/extern.go
        Insertions: 6, Deletions: 7.

        @@ -18,20 +18,19 @@
        A collection is triggered when the ratio of freshly allocated data to live data
        remaining after the previous collection reaches this percentage. The default
        is GOGC=100. Setting GOGC=off disables the garbage collector entirely.
        -The runtime/debug package's SetGCPercent function allows changing this
        -percentage at run time. See https://go.dev/pkg/runtime/debug/#SetGCPercent.
        +[runtime/debug.SetGCPercent] allows changing this percentage at run time.

        -The GOMEMLIMIT sets a soft memory limit for the runtime. This memory limit
        -includes the Go heap and all other managed by the runtime, and excludes
        -external memory sources such as mappings of binary itself, memory managed in
        +The GOMEMLIMIT variable sets a soft memory limit for the runtime. This memory limit
        +includes the Go heap and all other memory managed by the runtime, and excludes
        +external memory sources such as mappings of the binary itself, memory managed in
        other languages, and memory held by the operating system on behalf of the Go
        program. GOMEMLIMIT is a numeric value in bytes with an optional unit suffix.
        The supported suffixes include B, KiB, MiB, GiB, and TiB. These suffixes
        represent quantities of bytes as defined by the IEC 80000-13 standard. That is,
        they are based on powers of two: KiB means 2^10 bytes, MiB means 2^20 bytes,
        and so on. The default setting is math.MaxInt64, which effectively disables the
        -memory limit. See https://go.dev/pkg/runtime/debug/#SetMemoryLimit for
        -additional details.
        +memory limit. [runtime/debug.SetMemoryLimit] allows changing this limit at run
        +time.

        The GODEBUG variable controls debugging variables within the runtime.
        It is a comma-separated list of name=val pairs setting these named variables:
        ```

        Approvals: Michael Pratt: Run TryBots Chris Hines: Looks good to me, but someone else must approve Russ Cox: Looks good to me, approved Gopher Robot: TryBots succeeded
        runtime: document GOMEMLIMIT in environment variables section

        For #48409.

        Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
        Reviewed-on: https://go-review.googlesource.com/c/go/+/410734
        Run-TryBot: Michael Pratt <mpr...@google.com>
        TryBot-Result: Gopher Robot <go...@golang.org>
        Reviewed-by: Chris Hines <chris....@gmail.com>
        Reviewed-by: Russ Cox <r...@golang.org>
        ---
        M src/runtime/extern.go
        1 file changed, 29 insertions(+), 2 deletions(-)

        diff --git a/src/runtime/extern.go b/src/runtime/extern.go
        index 5437888..15c519d 100644
        --- a/src/runtime/extern.go
        +++ b/src/runtime/extern.go
        @@ -18,8 +18,19 @@
        A collection is triggered when the ratio of freshly allocated data to live data
        remaining after the previous collection reaches this percentage. The default
        is GOGC=100. Setting GOGC=off disables the garbage collector entirely.
        -The runtime/debug package's SetGCPercent function allows changing this
        -percentage at run time. See https://golang.org/pkg/runtime/debug/#SetGCPercent.
        +[runtime/debug.SetGCPercent] allows changing this percentage at run time.
        +
        +The GOMEMLIMIT variable sets a soft memory limit for the runtime. This memory limit
        +includes the Go heap and all other memory managed by the runtime, and excludes
        +external memory sources such as mappings of the binary itself, memory managed in
        +other languages, and memory held by the operating system on behalf of the Go
        +program. GOMEMLIMIT is a numeric value in bytes with an optional unit suffix.
        +The supported suffixes include B, KiB, MiB, GiB, and TiB. These suffixes
        +represent quantities of bytes as defined by the IEC 80000-13 standard. That is,
        +they are based on powers of two: KiB means 2^10 bytes, MiB means 2^20 bytes,
        +and so on. The default setting is math.MaxInt64, which effectively disables the
        +memory limit. [runtime/debug.SetMemoryLimit] allows changing this limit at run
        +time.

        The GODEBUG variable controls debugging variables within the runtime.
        It is a comma-separated list of name=val pairs setting these named variables:

        To view, visit change 410734. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ia6616a377bc4c871b7ffba6f5a59792a09b64809
        Gerrit-Change-Number: 410734
        Gerrit-PatchSet: 4
        Gerrit-Owner: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Austin Clements <aus...@google.com>
        Gerrit-Reviewer: Chris Hines <chris....@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: Russ Cox <r...@golang.org>
        Gerrit-MessageType: merged
        Reply all
        Reply to author
        Forward
        0 new messages