-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Bug Causing Dart.exe to Eat Up All Available Memory. #56355
Comments
Summary: The user is experiencing a memory leak in |
It reproduces locally on gWindows with following log: Dart analysis issueOut of Memory Version information
DetailsOut of Memory
Debug log
|
cc @scheglov |
Analyzer eating through all available memory should not be P2. Can somebody look at this? |
@aam can you still reliable reproduce this? I have tried different variants of
and none of them cause OOM. |
@mraleph wrote
I think so, yes. I have import 'package:http/http.dart' as http;
class CurrencyExchanger {
final Uri? currencyURL;
const CurrencyExchanger({required this.currencyURL});
Future getData() {
http.Response response = http
}
} in the root of dart sdk repo that I go back and forth adding/removing characters after " = http". The runaway growth starts at second 44 in the video below That is on
|
I still can't reproduce OOM myself but what I managed to reproduce is analyzer getting stuck. If I start with import 'package:http/http.dart' as http;
class CurrencyExchanger {
final Uri? currencyURL;
const CurrencyExchanger({required this.currencyURL});
Future get() {
http.Response response = http
}
} and then I type @scheglov does analyzer team have some easy way of replaying reproductions like this? |
I don't think we have an existing way to replay Analysis Server protocol logs. |
I can reproduce it manually though, and see in Observatory where it goes into a cycle, or at least uses too much CPU. |
I don't think we do either, but we can write a test that sends repeated 'overlay' requests to the server simulating what happens as the user types. |
Can be reduced to requesting completion at void get^() {
http.Response response = http
} So far it seems that linking of tokens via |
It looks that there is an issue with parser recovery.
|
Bug: #56355 Change-Id: I0cd58070853cfe0fa59788b3ed4586fc156e27d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388054 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
cc @jensjoha for recovery issues. |
This is not the parser. sdk/pkg/analyzer/lib/src/fasta/ast_builder.dart Line 3649 in 9f23661
even while we're parsing. All the rewrites happening on
in From Parser.ensureSemicolon via Parser.parseVariablesDeclarationRest From AstBuilder.endVariablesDeclaration via Parser.parseVariablesDeclarationRest From Parser.ensureSemicolon via Parser.parseExpressionStatement |
Bug: #56355 Change-Id: I1ee7f837dc8beed9bb2ed1f27c45108345e7cceb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392460 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Phil Quitslund <pquitslund@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
There's a reproducible bug that causes dart.exe to take up all available RAM in my device; I was able to reproduce this bug multiple times. I couldn't find any good solution online though.
the only packaged I used for this project is the http package published by dart.dev.
The issue occurs exactly when i type "http.Response response = http.g" inside the Future method to use the get method for that package.
Thank you,
The text was updated successfully, but these errors were encountered: