aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-11-09 20:21:03 -0500
committerRuss Cox <rsc@golang.org>2014-11-09 20:21:03 -0500
commit2ad99f09609de1e709aeacaeb277d637729e8081 (patch)
tree3cf6e9c347894281159e487e52abd789949693f8
parent2cd05c34046c4802fb2494c718d651045c2a3eb0 (diff)
downloadgo-2ad99f09609de1e709aeacaeb277d637729e8081.tar.gz
go-2ad99f09609de1e709aeacaeb277d637729e8081.zip
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
-rw-r--r--src/runtime/sema.go1
1 files changed, 1 insertions, 0 deletions
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)
}