I have a container with a dotnet core application running in Azure Kubernetes Service. No memory limits were specified in Pod specs.
The question is why GC.GetTotalMemory(false) shows approx. 3 Gb of memory used while AKS Insights shows 9.5 GB for this Pod container?
As I understand GC.GetTotalMemory(false)
returns the size of managed objects in bytes but the entire working memory set is much larger because memory is allocated in pages and because of managed heap fragmentation and because GC is not performed.