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

Remove potential leaks when type providers are misauthored #6409

Closed
cartermp opened this issue Apr 1, 2019 · 2 comments
Closed

Remove potential leaks when type providers are misauthored #6409

cartermp opened this issue Apr 1, 2019 · 2 comments
Milestone

Comments

@cartermp
Copy link
Contributor

cartermp commented Apr 1, 2019

(copied and paraphrased over from @dsyme's PR)

The following mistakes in type provider authoring can result in a memory leak:

  1. If TP instances have mistakenly kept themselves alive by F# compiler not disposing them correctly
  2. If a TP registers itself in global state, e.g. in a callback in a file watch timer or stores itself in global state in its own .dll
  3. if a TP saves one of its generated ProvidedTypeDefinition in a global cache in its own .dll

The compiler should be able to still release these resources.

@smoothdeveloper
Copy link
Contributor

Not too familiar with TP implementation, but it seems that the anti pattern here is storing reference to the TP instance, and maybe this extends to some other objects generated there.

Should this issue be tracked in https://github.com/fsprojects/FSharp.TypeProviders.SDK?

It maybe the guidelines in documentation and samples that would benefit from adding emphasis regarding potential memory leak if not following some rules.

@cartermp
Copy link
Contributor Author

cartermp commented Apr 8, 2019

Fixed in #6394

@cartermp cartermp closed this as completed Apr 8, 2019
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

No branches or pull requests

2 participants