I'm doing some high density hosting of ASP.NET MVC 5 / WCF apps on Azure App Service and the idle apps are using 600~1000MB of memory each which is quite a lot, given that a memory dump reveals that the GC heap is only about ~40MB full. I suspect this is due to server GC so i tried disabling it by following https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcserver-element and adding
<gcServer enabled="false" />
to my web.config, but this does not appear to have any effect as
GCSettings.IsServerGC
is still returning true. What am i missing here?
EDIT:
Using normal IIS it can be done using https://weblogs.asp.net/owscott/setting-an-aspnet-config-file-per-application-pool but in Azure App Service, you lack the permissions to do this.