Skip to content

Add the leak_vm meta-data in add-to-app sample #996

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
Jan 22, 2022

Conversation

eggfly
Copy link
Member

@eggfly eggfly commented Jan 19, 2022

Add an example code for custom switch leak VM settings, issue link:

Related PR:

Pre-launch Checklist

  • I read the [Flutter Style Guide] recently, and have followed its advice.
  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

Worth adding a comment about the Flutter version where this will be enabled.

@redbrogdon
Copy link
Contributor

This looks ready to land, though I'd like to make sure I completely understand the change. 😄

I've read through flutter/flutter#95903, and it looks like setting the flag to false will cause the Android embedder to avoid leaking the VM into the overall process, making it possible for the VM to be fully shut down while the app is running.

Is there a reason why it makes sense to set this flag only in the "multiple Flutters" example? Is it due to the fact that this is the only sample that manually spins up and shuts down engine instances over a single run?

@eggfly eggfly merged commit 0024df9 into flutter:master Jan 22, 2022
@eggfly eggfly deleted the leak_vm_metadata branch January 23, 2022 06:10
@eggfly
Copy link
Member Author

eggfly commented Jan 23, 2022

This looks ready to land, though I'd like to make sure I completely understand the change. 😄

I've read through flutter/flutter#95903, and it looks like setting the flag to false will cause the Android embedder to avoid leaking the VM into the overall process, making it possible for the VM to be fully shut down while the app is running.

Is there a reason why it makes sense to set this flag only in the "multiple Flutters" example? Is it due to the fact that this is the only sample that manually spins up and shuts down engine instances over a single run?

Yes, I think it's the only one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants