1
0
mirror of https://github.com/golang/go synced 2024-11-19 09:04:41 -07:00

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
This commit is contained in:
Russ Cox 2014-11-09 20:21:03 -05:00
parent 2cd05c3404
commit 2ad99f0960

View File

@ -259,6 +259,7 @@ func syncsemrelease(s *syncSema, n uint32) {
}
s.tail = w
goparkunlock(&s.lock, "semarelease")
releaseSudog(w)
} else {
unlock(&s.lock)
}