Code First Memory Usage in ASP.NET MVC and EF entity-framework performance


I have an ASP.NET MVC 3 application that utilizes EF CTP 5 for data access and SQL CE for storage.

After deploying this site to a shared server, I discovered that it was being recycled often since it exceeded the 100 MB limit for their (dedicated) application pools.

The website takes around 110 MB of RAM while it is in release mode.

Although I tried using SQL Server Express instead of CE, there was minimal change.

The only notable change was when I entirely eliminated EF (using a fake repo). The memory use was reduced to 30–40 MB. I reasoned that this wasn't too awful as a blank MVC template requires around 20 MB.

Exist any "standard" ASP.NET MVC application benchmarks?

It would be helpful to learn about the memory use that other EF CTP users are seeing and to get any recommendations for memory profiling tools (preferably free ones).

It's important to note how I'm managing the EF ObjectContext's lifespan. I'm using StructureMap to instantiate the ObjectContext and session per request to create the Session:

For<IDbContext>().HttpContextScoped().Use(ctx => new MyContext("MyConnStringName"));

Ben, many thanks

2/18/2011 6:39:00 PM

Accepted Answer

2/26/2011 10:27:00 AM

Popular Answer

The funny thing is, I think they got their estimate from this URL:

P.S. Check out the article to see if you're doing anything similar to what the author is stating. For instance, cache your pages.

P.S.S. Our system is now using 50 megs, according to a recent check. We are using EF CTP 4 and MVC 2.

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow