2

I'm looking for a way to increase .NET application startup time.

Idea is to make a process memory dump right after startup initialization and store it on disk. On second run it would be nice to replace process memory with that dump and speedup application start.

So, my questions:

  1. Is there a way to make a dump of .NET process memory?
  2. Is there a way to restore process memory state from that dump?
  3. Is solution (if it exists) applicable to IIS-hosted ASP.NET application?

Thanks.

Dmitriy Startsev
  • 1,442
  • 10
  • 19

2 Answers2

5

Raw memory dumps don't really work like that; a lot of things will be handles to things outside that single process, and will explode really badly if you try to replay it. What you need to do is to look at what is causing startup to be slow. For example, if the problem is loading configuration and setup data (say, from a database), then there might be some way to serialize that information so that it can be reloaded from a simple store locally, without as much overhead. You might look at tools like "ilmerge" and "ngen" (which reduce "fusion" and "jit" time, respectively) - but frankly those things are kinda overkill for almost all scenarios.

In the case of IIS: consider a cluster of servers. It doesn't really matter how long a server takes to start up if it isn't in the cluster at the time.

But: first measure, then act.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • We have a cluster on production, but on developer's machine or on test server it takes whole life to start. Really slow part of a startup is IoC container (Castle Windsor) initialization. Container configuraion is not marked as Serializable. Large number of classes and dependency graphs makes cold start so slow... – Dmitriy Startsev Jan 17 '13 at 21:17
  • @DmitriyStartsev heh; *yes*, IoC can take a bit of configuring. I don't have a magic wand for that, I'm afraid. – Marc Gravell Jan 17 '13 at 21:45
2

(Probably out of topic looking at last author comments to previous post speaking about developper machines ...)

To make ASP.Net boot faster, have you already considered following solutions before digging into nightmares of memory management :

Just to look at what a .Net Memory Dump looks likes, you have answers here : .NET Memory Profiling Tools (and you will see that it's quite huge !)

Community
  • 1
  • 1
Benoit74B
  • 1,815
  • 13
  • 11