-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Redundant DependencyContext instance #4335
Comments
This is a known issue tracked by https://github.com/dotnet/cli/issues/1736 |
@rynowak dotnet/cli#1736 is about the references that the compilation options hold on to. This one is about there being 2 instances. It appears that we want to have just one, as both are identical. |
If this is a very recent build, it might also be caused by some shenanigans due to us copying the dependency code into MVC itself to make it work with the most recent CLI. @pranavkm could that be the case? |
Nah, this was the case before that change. This is going to be fixed by changes @javiercn is working on because We'll want to take a look at the Razor/Roslyn stuff across the board depending on what else @DavidObando finds. We might be holding on to too much. |
@javiercn parking this on your plate to verify after the parts feature is done. |
Application parts are in and IAssemblyProvider is gone for good. @DavidObando what do we need to do here to verify? |
@javiercn cool! Run the HelloWorldMvc process, load test it, and then attach WinDbg to it. Download
Then execute:
You should see only one instance listed. Let me know if you'd like me to test it too. |
VS and dotmemory can also dump managed memory |
@rynowak already took measurements this morning, so I'm closing this as fixed :) |
We're analyzing the memory state after running the HelloWorldMvc test and sending 1000 requests to it. Unexpectedly, we're seeing 2 instances of DependencyContext.
There are two instances of
Microsoft.Extensions.DependencyModel.DependencyContext
in gen2 memory, one for theDefaultAssemblyProvider
, and another one for theDefaultRoslynCompilationService
.These objects seem to be identical, each consuming 1153536 (inclusive) bytes and containing the same data for all the fields that were inspected. The total usage of gen2 memory in this particular measurement was 7865208 bytes, meaning that each DependencyContext is ~1/6 of the consumed gen2 memory.
We should verify if this is intended.
/cc: @sajayantony @davidfowl @rynowak
The text was updated successfully, but these errors were encountered: