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

Another flutter engine is created.. #15

Open
SpiciedCrab opened this issue Jul 31, 2019 · 2 comments
Open

Another flutter engine is created.. #15

SpiciedCrab opened this issue Jul 31, 2019 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@SpiciedCrab
Copy link

Though it's an awesome solution to make the isolates support the plugins or channels , the solution seems to create a new flutter engine then mark it as the root isolate , all the messages or operations will be finished on it.
So I guess it may raise some memory issues if two engines exists at the same time....

@rmawatson
Copy link
Owner

yes, its probably not ideal. Although I don't know how much memory launching another engine actually uses, I suspect there is a lot of stuff loaded that doesn't need to be and is left unused. Unfortunately there is nothing more granular in the api that I could see for launching dart code in another isolate.

@nmfisher
Copy link
Collaborator

I have also wondered whether a FlutterEngine is actually needed - in theory it should be possible to spawn a plain Dart isolate and just hook up the corresponding plugin channels manually. This would avoid all the overhead associated with an actual FlutterEngine, but would obviously require care to ensure that any spawned isolates do not assume the existence of any engine-specific behaviour.

If anyone wants to look into this, PRs are welcome.

Note this is separate from the work here #73 - using FlutterEngineGroup still spawns a FlutterEngine, even if it's slightly lighter weight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants