Server GC vs. Workstation GC
-
Hi, Everyone, I read from a Microsoft guide on Performance (www.serverside.net) and it says that Windows Services uses Workstaton GC even Server has multiple CPU. The conclusion seems to be that we should not host TCP Remoting in WinSvcs. My Questions: (1) Is the above true or false ? (I have seen various opinion on this) (2) How to configure to use Server GC ( I have some idea but not sure about it. But I will open source it so everyone can comment later. Your open minded comment are greatly appreicated. Thanks James
-
Hi, Everyone, I read from a Microsoft guide on Performance (www.serverside.net) and it says that Windows Services uses Workstaton GC even Server has multiple CPU. The conclusion seems to be that we should not host TCP Remoting in WinSvcs. My Questions: (1) Is the above true or false ? (I have seen various opinion on this) (2) How to configure to use Server GC ( I have some idea but not sure about it. But I will open source it so everyone can comment later. Your open minded comment are greatly appreicated. Thanks James
If the .NET Framework is implicitly loaded, by loading a managed executable or loading a library into a process where the Framework isn't already loaded, the Workstation GC will always be used. To use the Server GC, you must explicitly load the framework by calling
CorBindToRuntimeEx
, exported bymscoree.dll
. See Writing High-Performance Managed Applications[^] and Implement a Custom Common Language Runtime Host for your Managed App[^]. You can find more information on Brad Abrams' blog at http://blogs.msdn.com/brada/archive/2003/12/12/50948.aspx[^] Stability. What an interesting concept. -- Chris Maunder -
If the .NET Framework is implicitly loaded, by loading a managed executable or loading a library into a process where the Framework isn't already loaded, the Workstation GC will always be used. To use the Server GC, you must explicitly load the framework by calling
CorBindToRuntimeEx
, exported bymscoree.dll
. See Writing High-Performance Managed Applications[^] and Implement a Custom Common Language Runtime Host for your Managed App[^]. You can find more information on Brad Abrams' blog at http://blogs.msdn.com/brada/archive/2003/12/12/50948.aspx[^] Stability. What an interesting concept. -- Chris MaunderMike, Thanks for your "real-time" response. I have read both articles: The 1st is great in concept and the 2nd has usable code. My Company blocked Blogging so I have to wait till after 6pm at home to read. I basically modified Steven Pratschner's code and made a Windows Services (.net) that calls Unmanaged API CorBindToRuntimeEx to run a remoting host code. (Just like you said). It really works as a TCP Remoting Host. Though My problem is that I would rather not use my code since it does not have PROVEN scalability in production.(and I do not have 8-CPU machine anyway) Is there any code I can download that has been proven ? Thanks James PS. I have no problem upload my code onto www.codeproject.com, so that we developer can improve and test it in this community.