Challenge (Help wanted) Possible memory problem
See original GitHub issueJust recently we updated the LightInject.Microsoft.DependencyInjection
package to confirm with the latest version of Microsoft.Extensions.DependencyInjection.Abstractions
. What we discovered pretty much by accident was that the memory consumption went through the roof when used in a ASP.NET Core web application.
What we have found so far is that it is probably related to how we resolve IEnumerable<T>
. In the old version of LightInject.Microsoft.DependencyInjection
we used to create an explicit registration of IEnumerable<T>
where we in the new version just offload this to LightInject itself. The latter causing the app to consume a lot of memory.
We have created a test web app to demonstrate this behavior and a toggle to switch between the old and the new way of handling IEnumerable<T>
Using the memory diagnostics in VS 2017 (15.8 preview 5) we can see that something is wrong.
With useExplicitEnumerable = false
With useExplicitEnumerable = true
So far we have not been able to reproduce anything like this apart from what we are seeing in the test web application. As mentioned it seems related to IEnumerable<T>
, but that is all we know for now.
Any suggestions/input on this problem would highly appreciated.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
No need. It’s already there 😄 Thanks a LOT for your help https://github.com/seesharper/LightInject/pull/436
Fixed by #436