GC pressure in CompositionConfiguration even when loading from cache
See original GitHub issueTargeting .NET Framework 4.7.2. First of all, I don’t understand why I see this when loading the MEF graph from disk. Why does it try to find loops when the deserialized graph obviously cannot have any loops?
I see lots of temporary allocations at
CompositionConfiguration.cs(297). It’s like 100 MB of Enumerable.Where<T>
that is thrown away, causing unwanted memory pressure.
I believe this can be optimized. I.e. don’t use LINQ, no matter what. If I find time, I’ll try to help out.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
c# - Simple caching makes GC go crazy?
I've profiled both methods and the "before" version was quite faster with ~18% time spent in GC, while the "after" version spend ~88%...
Read more >8 Techniques to Avoid GC Pressure and Improve ...
Poor memory management can hurt performance in many ways. One such effect is called GC Pressure or Memory Pressure. GC Pressure (garbage ......
Read more >When a disk cache performs better than an in-memory cache ...
If the heaps are not compacted, then any gaps in between "live" objects (live objects are those that the GC finds to still...
Read more >Garbage collection and cache eviction
gc () To determine whether an object is reachable, the cache starts from all known root objects (usually Query and/or Mutation ) and...
Read more >Guidance on the usage of Compact() on a MemoryCache
Memory pressure is always the GC cleanup trigger. it doesn't matter if there is CPU load or not. Removing the items from the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re right. The cache is loaded using
catalogManager.LoadAsync()
and then thisCompositionConfiguration.Create()
API is called. I guess I need to re-work my caching mechanism to avoid this when loading from cache.Possibly. But a million enumerator allocations would certainly be of importance. We have an enormous amount of exports and imports.