views:

89

answers:

2

Hi, i am trying to run performance counters on a .NET application and i would like to ensure the environment is the same between rebuilds. So far i can only think that the best way is to reboot the pc before each test to make all test COLD. is there another way to achive the same environment without rebooting each time?

+1  A: 

Run it in multiple instances of a virtual machine maybe?

jeef3
+2  A: 

What exactly are you trying to test in your application? You should be aware that when you compile code you are only generating IL that is compiled again at runtime by the JIT. This is done every time your application is run (unfortunately).

So unless you are testing something very minute or something specific to the CLR, I'd say this is a waste of your time.

Edit: It seems you could be worried about memory already being allocated on the heap. Assuming that there is sufficient free memory between runs, you should see only very small differences between runs. If you are running close to the limit (3Gb for 32-bit applications), then you'll have to ask someone more knowledgeable about system simulation and performance testing.

Hope this helps.

Ty