We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following benchmark consumes unlimited amount of memory:
func BenchmarkSyncLeak(b *testing.B) { const ( G = 1000 S = 1000 H = 10 ) var wg sync.WaitGroup wg.Add(G) for g := 0; g < G; g++ { go func() { defer wg.Done() hold := make([][]uint32, H) for i := 0; i < b.N; i++ { a := make([]uint32, S) atomic.AddUint32(&a[rand.Intn(len(a))], 1) hold[rand.Intn(len(hold))] = a } _ = hold }() } wg.Wait() }
The main cause is that race runtime does not wipe stale synchronization objects from heap memory blocks.
The text was updated successfully, but these errors were encountered:
CL https://golang.org/cl/19970 mentions this issue.
Sorry, something went wrong.
caa2147
No branches or pull requests
The following benchmark consumes unlimited amount of memory:
The main cause is that race runtime does not wipe stale synchronization objects from heap memory blocks.
The text was updated successfully, but these errors were encountered: