I'm running some performance tests on some .NET code that processes lots of data. I want some tests that ensure the garbage collector isn't influencing my results. How do I temporarily pause the garbage collector?
There is not a way to do this through the BCL APIs.
Turning it off for the profiling of a particular algorithm is also not a great idea because it will yield false results. The garbage collector will run during the execution of your program. Profiling without the GC could hide real problems with your algorithm if it causes lots of garbage collections in the real world.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With