-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestanalyzer-stabilityarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-performanceIssue relates to performance or code sizeIssue relates to performance or code size
Description
Description
We have a bigger flutter application with around 100k lines of code. We have almost all lint rules enabled. From time to time the RAM usage of dart rises to 8GB or even 14GB. Killing the dart process brings it down to a few hundred MBs temporary. We couldn't find a clear pattern yet when it rises, but when running the flutter app in the simulator, it definitely happens more often.
Dart SDK version
Dart SDK version: 3.5.3 (stable) (Wed Sep 11 16:22:47 2024 +0000) on "macos_arm64"
Attachments
- I attached an LSP report based on the tool from @mraleph
- I also have an analyzer snapshot, I can send it over privately or upload it to GDrive and share it. I don't want to share it here since it can contain sensitive information.
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestanalyzer-stabilityarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-performanceIssue relates to performance or code sizeIssue relates to performance or code size
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-]Dart process consuming a lot of memory, slow autocomplete[/-][+]Dart process consuming 4GB of memory, slow autocomplete[/+][-]Dart process consuming 4GB of memory, slow autocomplete[/-][+]Dart process consuming 14GB of memory, slow autocomplete[/+]mraleph commentedon Nov 22, 2024
Please don't share that! It contains the structure of your code and might contain large portions of your source (because strings and possibly token sequences are included into the snapshot). Even if you were willing to share it with us privately we can't look at it directly for this reason.
However I was considering writing a special tool to drop sensitive information from these snapshots to make it possible to share them.
mraleph commentedon Nov 22, 2024
@The-Redhat looking at the provided snapshot I can see 1Gb of Declaration objects which was fixed by @scheglov. I wonder if this is possible for you to try master channel?
The-Redhat commentedon Nov 22, 2024
Thanks for letting me know, then I will not share it at all.
sure I can try that, I downloaded the latest master dart-sdk. I just need to debug why vs code is not picking it up. Setting
"dart.sdkPath": "/Users/{username}/dart-sdk"
, didn't work so far. It keeps using the version provided by flutter.Anything else I can provide you to help debug it?
runyaga commentedon Nov 22, 2024
https://dartcode.org/faq/#why-cant-dart-code-find-my-dartflutter-sdk
Check your PATH
The-Redhat commentedon Nov 25, 2024
We have tested the new dart sdk version 3.7.0 internally, and it seems to work quite well. Is there already an ETA when it will be available in the flutter beta channel?
Currently, it is a bit tricky to use another dart sdk alongside the flutter stable channel. We are fine to switch to the flutter beta channel, but we don't want to switch to master.
If somebody has a good setup on how to use a different dart sdk alongside flutter, please share it.
The-Redhat commentedon Dec 2, 2024
@mraleph any update on the timeline?
srawlins commentedon Dec 2, 2024
No update on the timeline of 3.7.
@mraleph or @scheglov can you point me to the commit that fixed the excessive Declaration objects? I can look into cherry-picking.
scheglov commentedon Dec 2, 2024
https://dart-review.googlesource.com/c/sdk/+/393020
https://dart-review.googlesource.com/c/sdk/+/393480
srawlins commentedon Dec 2, 2024
Oof,
-6625 +112
diff and-1343 +465
diff, landing ~25 days after the last 3.6.0 dev release. I suspect this would be a difficult and risky cherry-pick.