Open JonasJW opened 5 months ago
@DanTup , do you see this? Have there been more reports of this kind?
/ cc @bwilkerson
I've not seen any other reports like this. 100% CPU certainly does not look healthy if it's persisting for a long period after initial analysis.
@JonasJW a few questions:
code --status
I think should give a summary of the number of each file type)We were having the same issue and using the custom_lint
package (v0.5.7).
Removing it completely seems to have solved the issue for us, are you using it too, and can you try to remove it to confirm it comes from there if you are ?
/cc @scheglov
@DanTup Thanks for the response and sorry for the late reply.
To be honest, I'm not quite sure what you mean by your question about symlinks or how I can find out.
Yes, this issue seems to have started just recently without making any noticeable changes such as updating SDKs, installing extensions, etc.
Here are further screenshots, I hope this is the server timing page you meant.
If you have any recommendations what I can try to fix this issue, I'm happy to try that. As mentioned, I have already tried uninstalling Flutter/Dart, VSCode, etc. at the moment I don't know what else I could try.
For us updating custom_lint
to 0.6.4
fixed the issue 🎉
@JonasJW thanks - the page I meant was the one marked "Timing" on the left.
Can you also confirm whether you're using any analyzer plugins? A few comments above suggest custom_lint
might have have issues (that may be fixed in 0.6.4).
You should be able to check for symlinks by running find . -type l -ls
in your project folder.
@DanTup thanks for the clarification!
I don't use custom_linter
or any analyzer plugins.
When I run find . -type l -ls
I get a long list of I suppose symlinks that probably just belong the the packages I use, for example:
111156169 0 lrwxr-xr-x 1 jonas staff 29 Mar 8 17:37 ./build/macos/Build/Products/Debug-platform/exercisable_flutter.app/Contents/Frameworks/FirebaseCore.framework/FirebaseCore -> Versions/Current/FirebaseCore
Is that anything out of the ordinary?
Here the screenshots of the "Timing" page:
When I run
find . -type l -ls
I get a long list of I suppose symlinks that probably just belong the the packages I use, for example:111156169 0 lrwxr-xr-x 1 jonas staff 29 Mar 8 17:37 ./build/macos/Build/Products/Debug-platform/exercisable_flutter.app/Contents/Frameworks/FirebaseCore.framework/FirebaseCore -> Versions/Current/FirebaseCore
Is that anything out of the ordinary?
That one doesn't look like a problem, but are there any that point back up the tree (eg. creating cycles or including other large parts of the disk in the the path)?
It may be useful to enable the analyzer instrumentation log (this file can get very large - be sure to turn it off afterwards) and reproduce the issue, and see if there is anything in the log file that looks out of place while this happens (for example exceptions, or paths you would not expect to be analyzed with this project open being analyzed).
You mentioned this only happens on large projects - are any of them public projects that I could test with (or that sharing logs from would not include anything sensitive)?
Hi @DanTup,
I apologize for taking so long to respond. I still have this issue and it's really slowing down my development process.
are there any that point back up the tree (eg. creating cycles or including other large parts of the disk in the the path)?
Here are a few symlinks, some point up but it doesn't appear to me that they would create a cycle
./windows/flutter/ephemeral/.plugin_symlinks/firebase_auth -> /Users/jonas/.pub-cache/hosted/pub.dev/firebase_auth-4.19.1/
./build/macos/Build/Intermediates.noindex/EagerLinkingTBDs/Debug/just_audio.framework/just_audio.tbd -> /Users/jonas/Documents/project_name/build/macos/Build/Intermediates.noindex/EagerLinkingTBDs/Debug/just_audio.framework/Versions/A/just_audio.tbd
./macos/Pods/Headers/Public/Firebase/Firebase.h -> ../../../Firebase/CoreOnly/Sources/Firebase.h
./ios/.symlinks/plugins/path_provider_foundation -> /Users/jonas/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/
./build/macos/Build/Products/Debug/FirebaseSharedSwift/FirebaseSharedSwift.framework/FirebaseSharedSwift -> Versions/Current/FirebaseSharedSwift
In total there are over 550 symlinks. Does any of this sound problematic?
I also tried the analyzer instrumentation logs but I can't really find anything that appears out of place. However, this document seems to log all kinds of stuff and I'm not sure how to analyze it or what to look for.
Yes, unfortunately, this project is private and can't be shared. I could probably share the analyzer instrumentation logs privately with you, if that would help.
I recently tested this project on a windows laptop and the issue occurs as well. (Thus, I think completely reinstalling my mac won't even help fix it).
These issues don't appear on new Flutter projects. Maybe I could try to download a big public project and see if I have problems with other bigger projects as well? If not it must be something specific with my project but I'm clueless about where the issue could be.
In total there are over 550 symlinks. Does any of this sound problematic?
Nothing above looks like an issue to me - the issue would be if the link points further up the tree so that walking the tree could cause endless cycles.
I also tried the analyzer instrumentation logs but I can't really find anything that appears out of place
The most useful thing would be knowing what's being logged during the periods where performance is bad. So if the bad performance is during startup, it would be the start of the logs (until the first progress
event with "kind": "end"
). If it's during completion, it would be what occurs between the textDocument/completion
request and the corresponding response.
Yes, unfortunately, this project is private and can't be shared. I could probably share the analyzer instrumentation logs privately with you, if that would help.
I can't accept anything confidential (instrumentation logs can contain contents of opened files and paths/errors for other files in the workspace), but if you're able to reproduce this on a copy of the project with anything confidential removed (and perhaps only a single test file open), you might be able to get a log that doesn't contain anything confidential you can share.
Something I forgot to ask earlier - can you confirm whether you have this option ticked in the VS Code (User or Workspace) settings?
Understood, I will go back to the logs and look for these progress events. If I have something to share I will follow up on it here.
The Dart: Only Analyze Projets With Open Files
was disabled. I'm trying to enable it to see it that improves it, I will update you on this.
The
Dart: Only Analyze Projets With Open Files
was disabled. I'm trying to enable it to see it that improves it, I will update you on this.
FWIW, my recommendation would be to not use that setting (and I should update the text). Although it sounds better for large projects, it was really added for a fairly specific case (command line editors that would provide the current working directory - which may be the user home dir - as the workspace folder). While the server will start up faster for very large workspaces, opening and closing files from different projects will trigger re-creating the analysis roots which can trigger "initial" analysis for those projects.
It's beneficial if you're opening a folder that contains 100 projects and maybe only opening files from a handful, but if you're jumping between a large portion of the projects in the workspace, it's probably worse overall.
Dart & Flutter has suddenly become unusable slow in VSCode. Intellisense won't load within 30+ seconds, syntax highlighting won't update, jumping to code definitions loads infinitely, etc.
This seems to be especially the case on bigger projects, on a newly created project it works fine. I tried switching to Android Studio which seems to behave similarly (maybe a little better).
I tried uninstalling all extensions, even completely removing VSCode with any data stored and reinstalling it. As soon as I install the Dart extension, it is unusable. I also tried setting the following settings:
I'm on macOS 14.4, VSCode Version 1.87.2 (Universal),
In the Activity Monitor, there is the
dart:analysis_server.dart.snapshot
process running with around 1 GB of used memory. I'm not sure if this is normal.Here is a screenshot from the Dart Analyzer (which I'm also having trouble opening)
dart info
output:General info
Project info
Process info
Any recommendations on how I could possible fix this would be very welcome!