Skip to content
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

Dart process consuming 14GB of memory, slow autocomplete #59596

Open
The-Redhat opened this issue Nov 22, 2024 · 4 comments
Open

Dart process consuming 14GB of memory, slow autocomplete #59596

The-Redhat opened this issue Nov 22, 2024 · 4 comments
Labels
analyzer-stability area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-performance Issue relates to performance or code size

Comments

@The-Redhat
Copy link

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.

lsp-report.json

@The-Redhat The-Redhat added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Nov 22, 2024
@The-Redhat The-Redhat changed the title Dart process consuming a lot of memory, slow autocomplete Dart process consuming 4GB of memory, slow autocomplete Nov 22, 2024
@The-Redhat The-Redhat changed the title Dart process consuming 4GB of memory, slow autocomplete Dart process consuming 14GB of memory, slow autocomplete Nov 22, 2024
@mraleph
Copy link
Member

mraleph commented Nov 22, 2024

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.

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
Copy link
Member

mraleph commented 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
Copy link
Author

The-Redhat commented Nov 22, 2024

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.

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.

Thanks for letting me know, then I will not share it at all.

@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?

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
Copy link

runyaga commented Nov 22, 2024

@pq pq added P1 A high priority bug; for example, a single project is unusable or has many test failures type-performance Issue relates to performance or code size labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-stability area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-performance Issue relates to performance or code size
Projects
None yet
Development

No branches or pull requests

5 participants