title: Callbacks are slow from com server
body: <p>I am using a native COM server from a .Net C# application</p>
  
  <p>Everything works fine except that callbacks from the COM server into the .Net application gradually becomes slower. The server and .Net application is always running on the same machine.</p>
  
  <p>Calling from .Net to the COM server is always fast.</p>
  
  <p>The strange thing is that it doesn't happen on all computers even if they run the same binaries.</p>
  
  <p>I have spent a lot of time on this issue. Compared environments where the callbacks are fast with ones where it is slow without finding anything special.</p>
  
  <ul>
  <li>The callbacks start fast but get exponentially slower over time.</li>
  <li>Doesn't matter if the callbacks are assigned to .Net methods or not.
  (There is a server switch to turn all callbacks off. That is how I know the problem is with the callbacks)</li>
  <li>The slow computers use Window 7 64-bit but the same configuration is fast on other computers.</li>
  <li>There are slow and fast computers on the same domain and network</li>
  <li>Doesn't matter if the user is local admin or standard user</li>
  <li>I have monitored Disk/Network activity but there is no difference between slow and fast</li>
  <li>There is no noticeable difference in memory consumption</li>
  <li>Looked at CLR memory from WinDbg but found nothing strange</li>
  </ul>
  
  <p>Some things I have noted:  </p>
  
  <ul>
  <li>The server process use 100% CPU when the callbacks are slow.</li>
  <li>Looked at the call stack with process explorer and the server is most of the time in one of the RPC Ndr* functions, i.e. <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa374215%28v=vs.85%29.aspx" rel="nofollow">NdrClientCall2</a>.</li>
  </ul>
  
  <p>I am now out of ideas and need some help to solve this.</p>