I'm trying to run Microsoft's CLR Profiler on an application of ours. It's a C#/.Net 4.0 app which controls industrial machinery at factories.
Microsoft's CLR Profiler dramatically slows down the target applications (10X to 100X, according to its author, Peter Sollich). In our case it slows down our app so much that it fails because the network equipment our app is talking-to times out during the lengthy process when the program first starts up of establishing connections with devices on the factory floor.
So what I want to do is start our app and let it finish its initialization and THEN attach the profiler. When I try that CLR Profiler says I have to "Turn off concurrent GC in the application's configuration file" for that to work.
Where exactly is the setting it's referring to? What is the configuration file and how can I access the setting in Visual Studio 2010?
Concurrent garbage collection enables interactive applications to be more responsive by minimizing pauses for a collection. Managed threads can continue to run most of the time while the concurrent garbage collection thread is running. This design results in shorter pauses while a garbage collection is occurring.
Concurrent Mark Sweep Collector Concurrent Phases After the remark pause, a concurrent sweeping phase collects the objects identified as unreachable. After a collection cycle completes, the CMS collector waits, consuming almost no computational resources, until the start of the next major collection cycle.
When the application calls a new operator to create an object, there might not be enough space left in the managed heap to allocate the object. In case of insufficient space, CLR performs garbage collection, which works in the generations.
Modify or create an App.Config file and set the following code
<configuration>
<runtime>
<gcConcurrent enabled="false"/>
</runtime>
</configuration>
This is from MSDN: How to: Disable Concurrent Garbage Collection. For more information on creating an App.Config look here
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