-
Notifications
You must be signed in to change notification settings - Fork 785
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
Visual F# Tools leak memory while reloading solutions #106
Comments
We should apply the linked fix to VF# Tools. |
/cc @quasilord |
I tried to do this, but there are more commits involved. |
partially addresses #106 closes #477 commit 5505b71 Author: Don Syme <donsyme@fastmail.fm> Date: Sun May 31 16:48:05 2015 +1000 fix tests for invalidation handlers commit 0871018 Author: Don Syme <donsyme@fastmail.fm> Date: Sun May 31 16:35:47 2015 +1000 add diagnostic counters to signature commit e8afa9c Author: Don Syme <donsyme@fastmail.fm> Date: Sun May 31 15:07:35 2015 +1000 Fix memory leak: not disposing even subscriptions to invalidation events
This was partially addressed by recent fix from @dsyme, but it looks like we still leak a bunch on reload. I've left it open to keep tracking remaining leaks. Moving out of VS 2015 milestone, though. |
@latkin AFAIK a well written type provider shouldn't leak on reload. What repro steps should I follow to check this out (I'm ok with this being vNext) |
Sorry, I was not specific enough. I trust that the type provider leak in particular is now fixed, but the general problem indicated by the title of the bug ("Visual F# Tools leak memory while reloading solutions") is not. |
OK, got it, thanks |
Re memory leaks - I noticed another case where the Fsharp.Compiler.Service code is correctly disconnecting a callback when a prjoect is unloaded, see https://github.com/fsharp/FSharp.Compiler.Service/blob/0c37365691e5568adfc357fc915eed645b45481d/src/fsharp/CompileOps.fs#L4093. |
Scenario:
◾Disable VFPT in VS if it is installed
◾Open VFPT solution (https://github.com/fsprojects/VisualFSharpPowerTools), VS occupies ~ 300MB RAM
◾Repeat the following steps 15 times: (1) Switch to a new git branch (2) Reload the solution (3) Rebuild the solution
◾VS now occupies ~ 1.7 GB RAM
Context:
We are hunting down memory leaks in Visual F# Power Tools. It turned out FSharp.Compiler.Service (FCS) leaked memories when Xaml type providers (FsXaml) didn't dispose resources correctly. These bugs have been fixed in FCS and FsXaml. See the discussion at fsharp/fsharp-compiler-docs#158.
After bug fixing, there are still memory leaks. I think Visual F# Tools has the same issue where type providers are in use. We did profile using PerfView without enabling VFPT. Here is a diff of two snapshots where we reload and rebuild solutions twice.
https://cloud.githubusercontent.com/assets/941060/3277997/c56876ec-f39f-11e3-8042-4840c6cffffd.png
https://cloud.githubusercontent.com/assets/941060/3278000/13a16d6e-f3a0-11e3-97cd-b994b8086d8e.png
Configuration:
I believe the fix should be similar to that of FCS. Here are relevant commits:
fsharp/fsharp-compiler-docs@a325df2
fsharp/fsharp-compiler-docs@4e7c8bc
Let me know if you need more information.
The text was updated successfully, but these errors were encountered: