How to: Configure garbage collection on the server
Learn how to configure garbage collection in a Microsoft Lync Server 2013 deployment.
Last modified: August 16, 2013
Applies to: Lync Server 2013
You can use the server-optimized garbage collector (GC), instead of the default workstation GC, to improve the performance of a Microsoft Lync Server 2013 SIP Application Managed API managed code application.
The workstation GC is the default GC mode and is the only GC that is used on single-processor computers. The workstation GC is hosted in console and Windows Forms applications. It performs full (generation 2) collections concurrently with the running program, with minimal latency. This mode is useful for client applications, where perceived performance is usually more important than raw throughput.
The server GC is available only on multiprocessor computers. It creates a separate managed heap and thread for each processor and performs collections in parallel. During collection, all managed threads are paused (threads running native code are paused only when the native call returns). In this way, the server GC mode maximizes throughput (the number of requests per second) and improves performance as the number of processors increases. Computers with four or more processors offer improved performance. All managed code applications that use the Lync Server 2013 SIP Application Managed API should use the server GC.
Using the Microsoft .NET Framework, you can run server GC in a non-hosted managed application by adding the following element to the application's configuration file.
<configuration <runtime> <gcServer enabled="true"/> </runtime> </configuration>
When you set the <gcServer/> element to "true", the <gcConcurrent/> element (the default workstation GC identifier) is disabled.
Ensure the configuration file name uses the MyApp.exe.config format and save it in the same directory as MyApp.exe.