Reduce memory profiling rate (#17894)

Change profiling from every 4KB to every 128K, reducing the lock contention by a factor of 32.
This commit is contained in:
Klaus Post 2023-08-22 07:21:49 -07:00 committed by GitHub
parent 1c5af7c31a
commit f506117edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,7 +345,7 @@ func getProfileData() (map[string][]byte, error) {
}
func setDefaultProfilerRates() {
runtime.MemProfileRate = 4096 // 512K -> 4K - Must be constant throughout application lifetime.
runtime.MemProfileRate = 128 << 10 // 512KB -> 128K - Must be constant throughout application lifetime.
runtime.SetMutexProfileFraction(0) // Disable until needed
runtime.SetBlockProfileRate(0) // Disable until needed
}