tags:

views:

68

answers:

1

On most platforms and with most JVMs you can pre-allocate the heap on start-up by setting the -Xmx and -Xms options (or a variant thereof) to the same size.

Is it possible to do the same with .NET, and if so, how?

+3  A: 

Sadly no it's not, .the NET runtime makes all the decisions about heap size and relative generational sizing for you.

The only thing you can do is switch between the server version of the garbage collector and the workstation one. This gives more aggressive, one GC per core collecting in the server version and a preference for keeping the app responsive in the workstation one.

Paolo
Thankyou.Which GC is the default, and how do you go about configuring a different GC?
sam_pointer
Workstation is the default. You can switch to the server version by adding a couple of lines to the config: http://blogs.msdn.com/junfeng/archive/2004/07/13/181534.aspx. If you have process explorer you can see which a process is using by finding either mscorwks.dll (workstation) or mscorsvr.dll (server) loaded
Paolo