I'm trying to get a handle on memory usage of my ASP.NET MVC4 / EF5 web application through dotMemory profiling. I'm still confused by what I see, but one thing that concerns me is the large difference in memory between running a profile on IISExpress and WebDev.
At start up, IISExpress shows (* Actually this jumped each time I killed the process and started up the profiler again):
Whereas WebDev:
This application is hosted on IIS 7.5 so which should I trust? And why does my managed memory go down after a snapshot? This is especially true with IISExpress.
Also I'm having a hard time finding what are real issues I can impact. Things tend to boil down to EF or AutoMapper and I don't see how I can avoid iterator allocation in entity linq queries and CreateMaps, etc. (http://blog.jetbrains.com/dotnet/2014/07/24/unusual-ways-of-boosting-up-app-performance-lambdas-and-linqs/)
What am I not seeing?
Edit
Memory Traffic snapshot -- String is the largest consumer
Lots of byte allocated from using AutoMapper's CreateMap -- any possible remedy?
Heap Gen 0: 242.7 MB
This is a specific thing of IIS to have a very huge Gen 0 heaps
And why does my managed memory go down after a snapshot? This is especially true with IISExpress.
dotMemory forces garbage collecting on getting snapshot (this is how MS profiling API works)
Also I'm having a hard time finding what are real issues I can impact.
I would recommend to check if a picture of the memory consumption correlates with a picture "in your head". Check top 5-10 types which objects consumes the greatest amount of the memory. Look at top objects exclusively retains memory. Check an app on memory leaks - all objects are released after a particular activity finishes. If you don't see any very unusual, maybe you do not have to do anything.