Skip to content

Commit 7a82c68

Browse files
committed
doc/go1.19: adjust runtime release notes
This addresses comments from CL 410356. For #48409. For #51400. Change-Id: I03560e820a06c0745700ac997b02d13bc03adfc6 Reviewed-on: https://go-review.googlesource.com/c/go/+/410735 Run-TryBot: Michael Pratt <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Chris Hines <[email protected]> Reviewed-by: Russ Cox <[email protected]>
1 parent f3e051a commit 7a82c68

File tree

1 file changed

+34
-19
lines changed

1 file changed

+34
-19
lines changed

doc/go1.19.html

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,35 @@ <h2 id="runtime">Runtime</h2>
103103

104104
<p><!-- https://go.dev/issue/48409 --><!-- CL 397018 -->
105105
The runtime now includes support for a soft memory limit. This memory limit
106-
includes all memory mapped and managed by the runtime, and excludes external
107-
memory sources such as binary size, memory managed in other languages, and
108-
memory held by the operating system on behalf of the Go program. This limit
109-
may be managed via the <code>GOMEMLIMIT</code> environment variable or the
110-
<code>SetMemoryLimit</code> function in the runtime/debug package. The limit
111-
works in conjunction with <code>GOGC</code> and <code>SetGCPercent</code>,
106+
includes the Go heap and all other memory managed by the runtime, and
107+
excludes external memory sources such as mappings of the binary itself,
108+
memory managed in other languages, and memory held by the operating system on
109+
behalf of the Go program. This limit may be managed via
110+
<a href="/pkg/runtime/debug/#SetMemoryLimit"><code>runtime/debug.SetMemoryLimit</code></a>
111+
or the equivalent
112+
<a href="/pkg/runtime/#hdr-Environment_Variables"><code>GOMEMLIMIT</code></a>
113+
environment variable. The limit works in conjunction with
114+
<a href="/pkg/runtime/debug/#SetGCPercent"><code>runtime/debug.SetGCPercent</code></a>
115+
/ <a href="/pkg/runtime/#hdr-Environment_Variables"><code>GOGC</code></a>,
112116
and will be respected even if <code>GOGC=off</code>, allowing Go programs to
113117
always make maximal use of their memory limit, improving resource efficiency
114-
in some cases. Please note that small memory limits, on the order of tens of
115-
megabytes or less, are less likely to be adhered to due to external latency
116-
factors, such as OS scheduling. See https://go.dev/issue/52433 for more
117-
details. Larger memory limits, on the order of hundreds of megabytes or more,
118-
are stable and production-ready.
118+
in some cases. See <a href="https://go.dev/doc/gc-guide">the GC guide</a> for
119+
a detailed guide explaining the soft memory limit in more detail, as well as
120+
a variety of common use-cases and scenarios. Please note that small memory
121+
limits, on the order of tens of megabytes or less, are less likely to be
122+
respected due to external latency factors, such as OS scheduling. See
123+
<a href="https://go.dev/issue/52433">issue 52433</a> for more details. Larger
124+
memory limits, on the order of hundreds of megabytes or more, are stable and
125+
production-ready.
119126
</p>
120127

121128
<p><!-- CL 353989 -->
122129
In order to limit the effects of GC thrashing when the program's live heap
123130
size approaches the soft memory limit, the Go runtime also attempts to limit
124131
total GC CPU utilization to 50%, excluding idle time, choosing to use more
125132
memory over preventing application progress. In practice, we expect this limit
126-
to only play a role in exceptional cases, and the new runtime/metrics metric
133+
to only play a role in exceptional cases, and the new
134+
<a href="/pkg/runtime/metrics/#hdr-Supported_metrics">runtime metric</a>
127135
<code>/gc/limiter/last-enabled:gc-cycle</code> reports when this last
128136
occurred.
129137
</p>
@@ -667,20 +675,27 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
667675
<dl id="runtime/metrics"><dt><a href="/pkg/runtime/metrics/">runtime/metrics</a></dt>
668676
<dd>
669677
<p><!-- https://go.dev/issue/47216 --><!-- CL 404305 -->
670-
The new <code>/sched/gomaxprocs:threads</code> metric reports the current
671-
<code>runtime.GOMAXPROCS</code> value.
678+
The new <code>/sched/gomaxprocs:threads</code>
679+
<a href="/pkg/runtime/metrics/#hdr-Supported_metrics">metric</a> reports
680+
the current
681+
<a href="/pkg/runtime/#GOMAXPROCS"><code>runtime.GOMAXPROCS</code></a>
682+
value.
672683
</p>
673684

674685
<p><!-- https://go.dev/issue/47216 --><!-- CL 404306 -->
675-
The new <code>/cgo/go-to-c-calls:calls</code> metric reports the total
676-
number of calls made from Go to C. This metric is identical to the <a
677-
href="/pkg/runtime/#NumCgoCall"><code>runtime.NumCgoCall</code></a>
686+
The new <code>/cgo/go-to-c-calls:calls</code>
687+
<a href="/pkg/runtime/metrics/#hdr-Supported_metrics">metric</a>
688+
reports the total number of calls made from Go to C. This metric is
689+
identical to the
690+
<a href="/pkg/runtime/#NumCgoCall"><code>runtime.NumCgoCall</code></a>
678691
function.
679692
</p>
680693

681694
<p><!-- https://go.dev/issue/48409 --><!-- CL 403614 -->
682-
The new <code>/gc/limiter/last-enabled:gc-cycle</code> metric reports the
683-
last GC cycle when the GC CPU limiter was enabled.
695+
The new <code>/gc/limiter/last-enabled:gc-cycle</code>
696+
<a href="/pkg/runtime/metrics/#hdr-Supported_metrics">metric</a>
697+
reports the last GC cycle when the GC CPU limiter was enabled. See the
698+
<a href="#runtime">runtime notes</a> for details about the GC CPU limiter.
684699
</p>
685700
</dd>
686701
</dl><!-- runtime/metrics -->

0 commit comments

Comments
 (0)