-
Notifications
You must be signed in to change notification settings - Fork 154
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
tons of memory used after 3 clicks #264
Comments
Hi @ctaggart can you please add info about:
about |
@enricosada I've very curious how you would go about troubleshooting this. I created the dump using Visual Studio 2017 by attaching to the process and then selecting Debug > Save Dump As. https://1drv.ms/u/s!AgzKxNqZP8-4gZwrlWI7zid3N6KJMw I'm running Windows 10.
I haven't changed the default Ionide configuration:
Should I try Don't you need the pdb files to troubleshoot? When I open up the dmp file and select an FsAutoComplete StackFrame, it complains that the pdb is not found. What about shipping source linked portable pdb files with Ionide? Currently Ionide takes up 22.6 MB on disk for me. Another few megabytes more of disk space would not hurt. |
mhh.. yes we miss pdb. we can add portable pdb too afaik. atm probably we need to run FSAC built from source to get the dump, and mean is bad |
Another stuff, is to start a discussion about how to improve perf. |
I've got pull requests open for the projects, but meanwhile, I've started making builds using appveyor for the projects and posting to myget: https://www.myget.org/feed/Packages/sourcelink So far I have Newtonsoft.Json & FParsec. |
What's the best way to measure performance and integrate into the CI process so that we can check for performance regressions? Does a new project with benchmarkDotNet (or similar) need to be added with the build.fsx updated? |
I am not sure how helpful this is, but I took a heap snapshot of fsautocomplete when opened on a basic enough fsproj, it seems that out of the 1.5gb, FsAutoComplete holds onto about 800mb, a very very naive guess shows the following:
Which seems like some pretty large numbers, however this code appears to come from the Lexer, so this makes sense. It will be interesting to see if fsharp/fslang-suggestions#648 will eliminate some of this allocation overhead (there is a fair bit of string copying happening inside However, this doesn't really account for some other performance situations where fsautocomplete peggs the CPU after a few hours of use (hard to reproduce), I haven't finished testing it (and am very cautious to suggest this is a fix), but it looks like one of the culprits may be here https://github.com/fsharp/FsAutoComplete/blob/d397eb6f6734c833d66b5c6e48eb032f4d2d320a/src/FsAutoComplete.Core/Commands.fs#L39 , which appears to leak AsyncContext into the environment (from memory it needs to have a |
It appears the latest version of ionide, which packs the latest version of FAC has improved the memory situation on my system. Can others try and report findings? |
@abk-x no improvement for me on linux. My computer eventually freezes due to the steady increase in FSAC memory/cpu usage! I've resorted to having a timer that reminds me to kill the process every 20 minutes. |
@ctaggart I recommend download PerfView: https://github.com/Microsoft/perfview/blob/master/documentation/Downloading.md You can use it to run a collection after you've opened your project(s) in VSCode: After ~30 seconds or so of using Ionide such that it will start using lots of memory or otherwise causing perf problems, you can stop collecting and analyze the trace. Here's an example of one I recently did.
(or in this case, You can drill into a specific call to see if it's the primary contributor. In the case of my trace, You can also look at CPU stacks to look at where relative CPU time is being spent. In the case of my trace, there were two strange entries: Combined, these made up ~5% of total CPU time, yet the utility they offered me (suggested names for a compile error) was very small because I was just writing code slowly enough to trigger a compile error here and there. The goal in an exercise like this is to determine:
|
We also need to look at doing another release of FSharp.Compiler.Service. The most recent is 4 months old per nuget, and I know the team has put in some good perf work since then. |
Not sure which version Ionide uses, but IIRC @Krzysztof-Cieslak does build the package from the VisualFSharp repo, so it may not be horribly out of date |
Ionide's using master of this repo, so the same 25.0.1 version that's ~4months old.
|
Ok, let's close this one. Ofc, memory usage is still high, but anything in this thread is outdated. If anyone has actionable reports about memory usage please create separate issues, preferably with PerfView analysis. |
After 3 clicks or so, VSCode with Ionide is using 1.2 GB of memory with most of it used by FsAutoComplete. This is a pretty basic .NET Core Project that targets
net46
. Memory usage seems a bit too high. Anything I can do to help get this back down?bundle source linked pdb files for:
The text was updated successfully, but these errors were encountered: