Worth studying https://tip.golang.org/doc/gc-guide The heap profile will show you the heap memory in use, but the OS process info will tell you the total process size, including memory in use, and memory GC which has been marked as free and reclaimed by the GC, but not relinquished to the OS. When the GC frees memory, it often does not return it to the OS, but keeps it around because it might be needed soon. You can only return entire pages to the OS, so the GC often can't return a memory page even if most of it is free, but a small part of it is still in use.
On Wednesday 21 February 2024 at 18:43:00 UTC Frank Flipper wrote: > it's a purely golang app > On Tuesday, February 20, 2024 at 9:38:35 PM UTC+3 Kurtis Rader wrote: > >> Is your app built with CGO? That is, do you link it against any C/C++ >> code that might be calling malloc? >> >> On Tue, Feb 20, 2024 at 5:22 AM Frank Flipper <frankf...@gmail.com> >> wrote: >> >>> I have an app that's put inside k8s container and is being monitored in >>> grafana. Memory usage graph shows me that one of the pods is using 50Gi of >>> memory, but when I go to <pod_ip>/debug/pprof/heap I only see that it's >>> using only 10-11Gi. I'm aware that pprof is not meant to track and show >>> every single allocation, but I'm bothered by difference in 40Gi. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "golang-nuts" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to golang-nuts...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/golang-nuts/8eb463f6-e608-40b0-8df5-c497e2a1414an%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/golang-nuts/8eb463f6-e608-40b0-8df5-c497e2a1414an%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> >> >> -- >> Kurtis Rader >> Caretaker of the exceptional canines Junior and Hank >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/333dfdbb-876b-4c3c-a953-a97256bf6d0bn%40googlegroups.com.