views:

60

answers:

1

I have an ASP.NET MVC application that also employs the typical NHibernate / Castle stack. On startup, the application's memory footprint sits around 190Mb and I wish to be able to run multiple isolated AppPools, each of which will serve a different domain. This is before really hitting anything serious in the database or putting anything in the ASP.NET Cache.

How would you go about reducing the standing footprint of the app?

I've looked at this article here on CodeProject which talks about sharing common DLLs in a specific AppDomain. Does anyone have any experience using this technique on ASP.NET?

+1  A: 

One simple way would be to use a shared web service (WCF) that will perform the data access so that each application wouldn't bother with it.

Darin Dimitrov
As I said in the question, this is before any real data access happens, so this approach won't help.
jmcd
Yes, but simply initializing an NHibernate session factory could consume much memory. What exactly are you doing in your `Application_Start` method that consumes memory?
Darin Dimitrov
Ah right, I see your point. I'm starting an Nhibernate session and a FullTextSession, and pulling some (12) services from DLLs and placing them in Windsor.
jmcd
Yes, this will consume lots of memory, while if you did this in a separate web service you will do it only once and all your applications will simply consume this service, that was my point.
Darin Dimitrov
jmcd
Well, what happens if you remove all this initialization? How much memory does your application consumes? Using the default ASP.NET MVC template and the VS built-in web server consumes 15MB of memory when you hit the first request.
Darin Dimitrov