Skip to content
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

Second half of fix for https://github.com/Microsoft/visualfsharp/issues/106 #591

Closed
wants to merge 2 commits into from

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Aug 14, 2015

FSharp.Compiler.Service contained a more complete fix for #106, which relates to the memory leaks that can arise if type provider instance objects are kept live. Historically the memory leaks have happened if a type provider registers itself to listen to file system events (or other notifications), but for some reason doesn't disconnect those listeners when the type provider is disposed. This keeps the type provider instance alive - which is a bug in the type provider - but even worse it can keep '00s MB of data associated with the compiler state alive as well.

The missing part of the fix is to disconnect the "TypeProviderConfig" callback when the type providers are disposed, so that even if a type provider instance hangs on to a reference to the TypeProviderConfig, that doesn't cause the entire object graph for the compilation session to be retained in memory.

After type provider disposal, any TypeProviderConfig objects provided to the type provider will now raise ObjectDisposedException when the SystemRuntimeContainsType method is called.

@latkin
Copy link
Contributor

latkin commented Sep 16, 2015

LGTM

@latkin latkin added this to the F# 4.0 Update 1 milestone Sep 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants