-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
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
Memory Issues with ListUsers #41
Comments
I was able to lower memory consumption by setting a lower value for the |
@robbertvdg Alloc numbers is typically the total amount allocated, look at Heap In Use. This looks like intended behavior, but you didn't share the |
Looking at the function, there is nothing there that can really be an issue. |
The function: func PrintMemUsage() {
var m run.MemStats
run.ReadMemStats(&m)
// For info on each, see: https://golang.org/pkg/runtime/#MemStats
fmt.Printf("Alloc = %v MiB", bToMb(m.Alloc))
fmt.Printf("\tTotalAlloc = %v MiB", bToMb(m.TotalAlloc))
fmt.Printf("\tSys = %v MiB", bToMb(m.Sys))
fmt.Printf("\tNumGC = %v\n", m.NumGC)
} |
Including m.HeapInUse: heap = 72 MiB Alloc = 69 MiB TotalAlloc = 159 MiB Sys = 140 MiB NumGC = 13 |
Not really seeing any leak there. Yes, the function could have pagination so a huge number of users don't take too much memory, but this is not really something that seems to worrysome. |
Yeah this looks like normal and will be relinquished properly to Go runtime as needed. |
Hi,
I saw a high memory consumption in our go application that uses the minio admin sdk. I tracked it down to the ListUsers function. It seems the results are not properly garbage collected with multiple calls.
Here is a code snippet and the memory consumption:
Memory usages:
Alloc = 99 MiB TotalAlloc = 123 MiB Sys = 139 MiB NumGC = 9
Alloc = 92 MiB TotalAlloc = 189 MiB Sys = 206 MiB NumGC = 10
Alloc = 156 MiB TotalAlloc = 253 MiB Sys = 206 MiB NumGC = 10
Alloc = 156 MiB TotalAlloc = 253 MiB Sys = 206 MiB NumGC = 10
Alloc = 156 MiB TotalAlloc = 253 MiB Sys = 206 MiB NumGC = 10
Alloc = 220 MiB TotalAlloc = 317 MiB Sys = 272 MiB NumGC = 11
Alloc = 220 MiB TotalAlloc = 318 MiB Sys = 272 MiB NumGC = 11
Alloc = 284 MiB TotalAlloc = 382 MiB Sys = 338 MiB NumGC = 11
Alloc = 284 MiB TotalAlloc = 382 MiB Sys = 338 MiB NumGC = 11
Alloc = 284 MiB TotalAlloc = 382 MiB Sys = 338 MiB NumGC = 11
Can this be investigated?
The text was updated successfully, but these errors were encountered: