-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
Ionide v5: Large memory footprint for FSAutoComplete processes #1464
Comments
Hey @theimowski 👋, Thank you for opening an issue. We will get back to you as https://opencollective.com/ionide
|
5.1 should include some performance fixes. However, as far as I know, 5.0 itself didn't introduce any performance regressions (5.1 fixes stuff that was around for ages). The only thing that has changed is that background service is now enabled by default. If you haven't got it enabled in 4.X then the memory usage was obviously lower (as there was no background service) |
@theimowski if your code isn't sharable for profiling, you can also try to collect a trace with the jetbrains tools (or perfview if you're a weirdo like me and @Krzysztof-Cieslak) to give a more detailed breakdown of memory usage over the 30s or so sample of actions taken. Traces like that tend to yield a lot more useful information about what the cause of certain problems could be. |
+1 for PerfView. |
I've just upgraded to 5.1 - will observe how it behaves for me and if necessary share perfview results |
With 5.1 the process can eat up over 20 gigs of RAM and whole CPU: Trying to grab a heap dump with PerfView but it times out after 100 seconds:
Unfortunately can't either take snapshot with dotMemory - it hangs, possibly due to my PC running out of resources I'll keep trying |
Is it happening just after start? Or is that some kind of memory leak happening over time? How big is the solution? It will be kinda hard to say anything useful without having context here ;-) |
It's happening over time, so seems rather like a memory leak, the solution is 8 F# + 4 C# projects. |
Here's a perfview gcdump when the process was at ~2GB: |
Closing - v5.2 seems to work much better 👍 |
I seem to have stumbled on a similar issue, if not the same. This is with the latest version of Ionide (5.3.2). Opening my solution with a few F# projects (essentially the SAFE template with just an additional project), one editor open, and background service disabled, the memory usage stabilizes around a reasonable level. However, running The first screenshot is taken some moments after running the This would seem to suggest some issue possibly related to caching and/or some interop issue with how Paket handles things. I'm not too familiar with the inner workings of Paket nor Ionide so I don't know what the issue might be. I'm happy to provide further information if that would be helpful. |
@vijoc This would definitely imply that there's a project system issue here, since that is the component responsible for forwarding references / doing design-time builds. High CPU usage would be expected for a Since you're on Windows, could you do the following?
These are the best way to look at performance, since they can tell folks exactly what's going on in your system. |
I'm experiencing a similar situation with After that, things stabilize and stay around 24GB, even if I repeat the same steps again. My solution contains about 25 projects and 250 source files. |
you're in luck! https://github.com/dotnet/diagnostics works perfectly on linux. I'd suggest using |
Sadly, vscode + ionide is still using a lot memory for me (Well, relatively spoken as this laptop only has 8GB). It is pretty much impossible for me to use as a result, as even with just vscode open my laptop quickly runs out of memory. If I start the project up then Below you find screenshots of my task manager of the before and after ( Please tell me if there is anything else I can provide to help diagnose this issue. memory dumps: repo: As my repo uses both generated code and Godot I made a copy of it with the generated files and Godot's .dll's already in place at |
Briefly commented on this in Discord, but it's going to be hard to say anything conclusive from those dumps. 100% that kind of reproduction is what helps to triage this sort of thing, though! Looking into the types returned, without knowing the exact call paths/GC roots, I see lots of the following types:
These don't surprise me at all. There are tons of areas of the FCS APIs where lists/maps of these items are computed or returned, and they can be quite large. However, the FCS used in the current shipped FSAC is 39.x. 40.x is out, and we have ongoing work to upgrade to it. New versions of FCS often have memory/performance enhancements, so the thing to do that's actionable to solve this would be:
|
This seems like the right place. I have the same issue as mentioned above, I have a pretty small application: 3 files with some recursive functions and the dotnet process will easily use 800MB at startup. If I type one line like: let b = 1 it will spike to 2,7GB in a couple of seconds. I have 32GB of RAM but this seems a bit excessive. I am running VS Code with .Net 6.1 SDK on Ubuntu. Summary Any idea of things I might try? |
Has this ever been adressed? I'm still seeing the same problem. Here is my Environment: Operatingsystem: Windows 10 (10.0.19042)
VSCode: 1.63.2
Ionide: 5.10.2
Net-SDK: 6.0.101
FSharp/FSI: F# Interactive version 12.0.0.0 for F# 6.0 A relatively small |
@boeremak @MarcoBuess If you can take a memory dump and trace of a reproducible action that leads to high memory/CPU usage and upload it that would be great. Otherwise it's just guesswork as to what's the cause. |
@cartermp Am I supposed to take the dump with |
A link to a fileshare could probably work (they're usually too large to accept for GitHub) |
So even though I didn't take the dumps yet I found something rather interesting. I was using the following code snipped to load a let loadConfig =
ConfigurationBuilder()
.SetBasePath(__SOURCE_DIRECTORY__)
.AddJsonFile("config.json").Build() Changing to code to this: let loadConfig () =
ConfigurationBuilder()
.SetBasePath(__SOURCE_DIRECTORY__)
.AddJsonFile("config.json").Build() Made the memory usage of the |
@MarcoBuess Interesting. Is this just with an idle script file, or does this also include executing it? |
@cartermp This is with an idle script file. If you use paket load-scripts with the #load @".paket/load/net6.0/main.group.fsx" The PS: Loading the script with the mentioned adjustments plus using |
I'm also experiencing this issue on my manjaro laptop with 8 gigs of ram. Process starts up with a reasonable memory footprint then eventually the process eats up the laptop memory and the pc crashes. My project is a single f# project with a couple of fsx scripts to fetch and organize data from the internet. |
I don't what has changed, but memory consumption is really down right now. Like orders of GBs. I don't know who to thank for this, but know it is much appreciated. Maybe a bit too fast, it is still at a couple of GBs. Seems lower though. |
Oh, that does indeed sounds great! Thanks to everyone involved. Can't wait to test it out! |
Can confirm. I updated Ionide to PS: The issue not only occurs in PSS: After working on the project for a couple of hours. Memory usage is up to ~3.5GB for |
I just came accross this OmniSharp issue. Starting the codebase with |
I keep getting ram usage of >5GB with Ionide on a single project. I frequently have to quit VsCode and reopen because my 16gb MBP m1 pro laptop runs out of memory as a result. And that's despite not running anything from within VsCode. (I run my F# project directly from Iterm2 (a terminal app)) |
fsautocomplete.dll and fsautocomplete.backgroundservices.dll dotnet processes consume large amounts of memory.
I've grabbed a snapshot using dotMemory and pasted screenshot of the overview tab - not sure whether it's helpful as is, but I'd be happy to provide more info if necessary.
Wasn't able to do same for backgroundservices process as dotMemory hanged.
I don't think I saw such footprints for the same workspace using ionide v4.
Screenshots
dotnet fsautocomplete.dll (PID 21400):
Machine info
The text was updated successfully, but these errors were encountered: