diff --git a/doc/articles/race_detector.html b/doc/articles/race_detector.html index 1c449da5c0..014411d948 100644 --- a/doc/articles/race_detector.html +++ b/doc/articles/race_detector.html @@ -395,3 +395,14 @@ func (w *Watchdog) Start() { The cost of race detection varies by program, but for a typical program, memory usage may increase by 5-10x and execution time by 2-20x.

+ +

+The race detector currently allocates an extra 8 bytes per defer +and recover statement. Those extra allocations are not recovered until the goroutine +exits. This means that if you have a long-running goroutine that is +periodically issuing defer and recover calls, +the program memory usage may grow without bound. These memory allocations +will not show up in the output of runtime.ReadMemStats or +runtime/pprof. +