From 2ad99f09609de1e709aeacaeb277d637729e8081 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 9 Nov 2014 20:21:03 -0500 Subject: [PATCH] runtime: fix sudog leak in syncsemrelease Manifested as increased memory usage in a Google production system. Not an unbounded leak, but can significantly increase the number of sudogs allocated between garbage collections. I checked all the other calls to acquireSudog. This is the only one that was missing a releaseSudog. LGTM=r, dneil R=dneil, r CC=golang-codereviews https://golang.org/cl/169260043 --- src/runtime/sema.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/sema.go b/src/runtime/sema.go index a42a29988a..d2a028c01b 100644 --- a/src/runtime/sema.go +++ b/src/runtime/sema.go @@ -259,6 +259,7 @@ func syncsemrelease(s *syncSema, n uint32) { } s.tail = w goparkunlock(&s.lock, "semarelease") + releaseSudog(w) } else { unlock(&s.lock) } -- 2.48.1