Disabling Concurrent Garbage Collection
Author: Panache
Creation Date: 11/9/2018 11:28 PM
profile picture

Panache

#1
Has anyone experimented with disabling concurrent garbage collection? According to Microsoft's DotNet Guide:
QUOTE:
To improve performance when several processes are running, disable concurrent garbage collection. You can do this by adding a <gcConcurrent> element to the app's configuration file and setting the value of its enabled attribute to "false".
https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals

My question primarily relates to whether this would be beneficial for optimizations and the ability to run multiple optimizations simultaneously.
profile picture

Panache

#2
In case anyone is interested, in my initial testing, optimizations run 5-10% faster with concurrent garbage collection disabled in WealthLabPro.exe.config.
profile picture

superticker

#3
QUOTE:
optimizations run 5-10% faster with concurrent garbage collection disabled
In a multi-core processor (My workstation processor has four cores.), the parallel garbage collection thread should run under its own core to minimize contentions with the main task(s) running on the other cores. Now all cores do share the same internal chip buses and access to the same off-chip front-side bus bandwidth (i.e. external RAM memory), so there's still come contention. I'm not sure if this contention is 5-10%, but there remains some contention between processor cores.

If you have tons of RAM (DIMM) memory and your strategy doesn't generate too much garbage (i.e. a small problem), you might get a slight speed up without concurrent garage collection. Otherwise, I would keep garage collection enabled.

Generally speaking, you're best off using conservative programming techniques to minimize the amount of garbage created in the first place. This will always be your best choice. Minimize the memory used and use the Principle of Locality to keep what is used localized in the code. That should also improve your processor cache hits, which will make the most speed difference.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).