-
Notifications
You must be signed in to change notification settings - Fork 790
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
Type Provider leaking memory in FSAC #15014
Comments
I think it is already wrong higher up - the fact that you have 2K (2.000) ResolveEventHandler instances is the suspicious thing. The event handler should be detached as soon as DependencyResolver is .Disposed()'d. Can't this be the reason? |
I took at look at anything we're using that uses
Maybe there's something in another dependency I'm not seeing. I don't know if there's any easy way to trace why so many |
The compiler service keeps one dependency resolver around, this should not lead to thousands of handlers. |
That is curious, I will check what has changed - I haven't seen any issue trying to explicitely address this. |
Haven't seen this in a long time gonna close it. |
Please provide a succinct description of the issue.
👋 I've been experiencing type providers leaking memory in the Adaptive LSP server in FSAC. It seems to happen when type checking across projects. On a file save, FSAC will scan for all dependent files and projects and type check them as well. When type providers are involved, it seems to recreate the type providers over and over and not releasing the older ones.
I can't get this to reproduce in Rider or VS so I'm not sure if it's related to the specific FCS version or the way FSAC is using FCS.
I think #14754 might benefit here but I still get the feeling something about lifetime management isn't working correctly. I did a very naive implementation of caching calls to
CreateTypeProvider
and it doesn't seem to create more instances.Also somewhat related issues:
Provide the steps required to reproduce the problem:
https://github.com/TheAngryByrd/css-type-provider-memory-leak
Expected behavior
No leaks.
Actual behavior
Here is a screenshot of dotmemory showing
ResolveEventHandler
's holding onto old information.Known workarounds
Provide a description of any known workarounds.
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: