问题
Has anyone else discovered a memory leak issue with Pull Subscriptions (ExchangeService.SubscribeToPullNotifications()
) in Exchange Managed Web Services API? When calling PullSubscription.GetEvents()
the memory utilization climbs 4K with nearly every polling call. The only way I've been able to keep the memory utilization down is by forcing garbage collection (via GC.Collect()
) after every call - an unnecessary path.
I am surprised to see the API hasn't changed for almost a year.
回答1:
This issue was resolved by another post. Essentially EWS was conflicting with another component that failed to release a NetworkStream
(due to a SqlException
). ANTS memory profiler was used to pinpoint the cause and timing of the issue. Without this profiling tool we would have never discovered the problem.
回答2:
I would say that if a GC.Collect reclaims the memory, there is no memory leak. There is just not pressure on the GC to perform a GC collection, since enough memory is available.
来源:https://stackoverflow.com/questions/7854008/ews-managed-api-1-1-pull-subscriptions-memory-leak