Skip to content

Commit acfff42

Browse files
mknyszekprattmic
authored andcommitted
doc/go1.19: add release notes for the soft memory limit and idle GC
This change resolves some TODOs in the release notes, and while we're here, also clarifies how CPU profile samples are represented in runtime traces. Change-Id: Idaa36ccf65b03fd5463b2d5da682d3fa578d2f46 Reviewed-on: https://go-review.googlesource.com/c/go/+/410356 Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Austin Clements <[email protected]>
1 parent a71ca3d commit acfff42

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

doc/go1.19.html

+29-4
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,37 @@ <h4 id="go-unix">New <code>unix</code> build constraint</h4>
8282

8383
<h2 id="runtime">Runtime</h2>
8484

85-
<p><!-- https://go.dev/issue/48409 -->
86-
TODO: soft memory limit
85+
<p><!-- https://go.dev/issue/48409 --><!-- CL 397018 -->
86+
The runtime now includes support for a soft memory limit. This memory limit
87+
includes all memory mapped and managed by the runtime, and excludes external
88+
memory sources such as binary size, memory managed in other languages, and
89+
memory held by the operating system on behalf of the Go program. This limit
90+
may be managed via the <code>GOMEMLIMIT</code> environment variable or the
91+
<code>SetMemoryLimit</code> function in the runtime/debug package. The limit
92+
works in conjunction with <code>GOGC</code> and <code>SetGCPercent</code>,
93+
and will be respected even if <code>GOGC=off</code>, allowing Go programs to
94+
always make maximal use of their memory limit, improving resource efficiency
95+
in some cases. Please note that small memory limits, on the order of tens of
96+
megabytes or less, are less likely to be adhered to due to external latency
97+
factors, such as OS scheduling. See https://go.dev/issue/52433 for more
98+
details. Larger memory limits, on the order of hundreds of megabytes or more,
99+
are stable and production-ready.
100+
</p>
101+
102+
<p><!-- CL 353989 -->
103+
In order to limit the effects of GC thrashing when the program's live heap
104+
size approaches the soft memory limit, the Go runtime also attempts to limit
105+
total GC CPU utilization to 50%, excluding idle time, choosing to use more
106+
memory over preventing application progress. In practice, we expect this limit
107+
to only play a role in exceptional cases, and the new runtime/metrics metric
108+
<code>/gc/limiter/last-enabled:gc-cycle</code> reports when this last
109+
occurred.
87110
</p>
88111

89112
<p><!-- https://go.dev/issue/44163 -->
90-
TODO: idle mark workers
113+
The runtime now schedules many fewer GC worker goroutines on idle operating
114+
system threads when the application is idle enough to force a periodic GC
115+
cycle.
91116
</p>
92117

93118
<p><!-- https://go.dev/issue/18138 --><!-- CL 345889 -->
@@ -494,7 +519,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
494519
<p><!-- CL 400795 -->
495520
When used together with the
496521
<a href="/pkg/runtime/pprof#StartCPUProfile">CPU profiler</a>, the
497-
execution trace includes CPU profile samples.
522+
execution trace includes CPU profile samples as instantaneous events.
498523
</p>
499524
</dd>
500525
</dl><!-- runtime/trace -->

0 commit comments

Comments
 (0)