question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Challenge (Help wanted) Possible memory problem

See original GitHub issue

Just 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>

https://github.com/seesharper/TestWebApp/blob/5c7ee7c3308eeaa3d1a5fb96a77bc6e0c3b6a859/TestWebApp/Startup.cs#L40

Using the memory diagnostics in VS 2017 (15.8 preview 5) we can see that something is wrong.

With useExplicitEnumerable = false

image

With useExplicitEnumerable = true image

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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
seesharpercommented, Aug 21, 2018

No need. It’s already there 😄 Thanks a LOT for your help https://github.com/seesharper/LightInject/pull/436

0reactions
seesharpercommented, Aug 21, 2018

Fixed by #436

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extreme memory leak, possibly my (mod) fault (help wanted)
Whenever I try to use my orbital strikes, the game RAM usage spikes enormously and never recovers. Ten or twelve strikes and Windows...
Read more >
Barriers to help-seeking for memory problems in older adults
The current study is designed to investigate possible barriers to action in terms of perceived memory problems in older adults.
Read more >
Your MEMORY challenges are AWESOME! - YouTube
Imagine if mindcap sent him limbo. 15:58 · Go to channel · Who Would Canonically Win? - Olimar vs Piranha Plant. Smash Bracket...
Read more >
Math: Memory Challenges
Helping Students with Poor Working Memory. Often an educational evaluation will describe a dyslexic student as having “low working memory.
Read more >
How to Improve Your Memory
Looking for a mental edge? Use these tips to improve your memory, boost your mental performance, and support brain health.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found