-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in Wcf integration #3
Comments
To fix issue AutofacInstanceProvider.GetInstance should be changed to smth like this:
|
And here is workaround without touching Autofac.Wcf source code:
And then (for self hosting):
For IIS/WAS you should register behavior with configuration |
Nice catch. When we get finished fighting DNX support into submission, we can take a look at this. Thanks! |
…fetime scope immediately when an exception is thrown in the constructor of the service being resolved.
Thanks for the detailed bug report. I have pushed 3.0.2 to NuGet with the code fix in |
We discovered memory leak in autofac wcf integration - if exception occurs during service resolution ILifetimeScope (and hence all dependencies resolved till exception thrown) are not disposed.
More detailed:
As a result Resource is never disposed.
This happens because autofac creates ILifetimeScope for the request, however it is not disposed because disposing implemented in AutofacInstanceProvider.ReleaseInstance which is not invoked if exception is thrown in AutofacInstanceProvider.GetInstance.
Here is sample code:
The text was updated successfully, but these errors were encountered: