这是indexloc提供的服务,不要输入任何密码
Skip to content

[flutter_tools] Put a heap size limit on the frontend_server #58039

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

Merged
merged 1 commit into from
May 27, 2020
Merged

[flutter_tools] Put a heap size limit on the frontend_server #58039

merged 1 commit into from
May 27, 2020

Conversation

zanderso
Copy link
Member

Description

In the issues below the frontend_server appears to be requesting large allocations for unknown reasons. This PR puts a limit of 2GB on the frontend_server's old gen heap size. When the limit is reached, or when an allocation request exceeds its size, the frontend_server will fail with an OutOfMemory exception rather than hitting a FATAL in the VM.

Related Issues

#54420
dart-lang/sdk#41862

Tests

I added the following tests:

I added a test that the KernelCompiler passes the heap limit flags.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

  • No, no existing tests failed, so this is not a breaking change.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 26, 2020
@zanderso zanderso requested a review from jonahwilliams May 26, 2020 22:29
@@ -648,6 +650,8 @@ class DefaultResidentCompiler implements ResidentCompiler {
);
final List<String> command = <String>[
globals.artifacts.getArtifactPath(Artifact.engineDartBinary),
'--disable-dart-dev',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a comment linking to the issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done.

@zanderso
Copy link
Member Author

/cc @jensjoha @dnfield

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmagman jmagman merged commit 29736f6 into flutter:master May 27, 2020
jonahwilliams pushed a commit that referenced this pull request Jun 2, 2020
jonahwilliams pushed a commit that referenced this pull request Jun 3, 2020
…#58525)

* Revert "[flutter_tools] Put a heap size limit on the frontend_server (#58039)"
@zanderso zanderso deleted the frontend-server-heap-limit branch July 17, 2020 15:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants