Skip to content

runtime: long stop-the-world due to scavenging when exceeding GOMEMLIMIT #73835

Open
@nsrip-dd

Description

@nsrip-dd

We have a program, built with Go 1.24.2, where we sometimes see very long stop-the-world pauses. The program has GOGC=off and a GOMEMLIMIT of ~12GiB. We see the pauses when the program has exceeded its memory limit.

For example, this execution trace shows a 400ms stop-the-world pause. The goroutine in proc 1 is trying to stop the world for sweep termination, and a CPU profile sample shows that it is trying to preempt goroutines. Meanwhile, the goroutine on proc 4 is running for 400ms, and all the CPU profile samples during that time show it calling runtime.sysUnused during runtime.(*pageAlloc).scavenge, where it can't be preempted. The third screenshot shows that GC is happening almost constantly during the trace.

Image Image Image

In our case, we can increase our memory limit if needed. I'm mainly filing this issue to document this worst-case behavior, in case there are things we could do to improve it.

cc @mknyszek

Metadata

Metadata

Assignees

Labels

NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions