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

Random out of memory issues iOS #25

Closed
vanlooverenkoen opened this issue Feb 18, 2021 · 2 comments · Fixed by #26
Closed

Random out of memory issues iOS #25

vanlooverenkoen opened this issue Feb 18, 2021 · 2 comments · Fixed by #26
Assignees
Labels
bug Something isn't working

Comments

@vanlooverenkoen
Copy link
Contributor

Sometimes we can use our app for 30 min
Sometimes the app crashes after 1 min

Could be related to the flutter engine that is used in the native iOS code

@vanlooverenkoen
Copy link
Contributor Author

If the background channel never receives an initialized result. The resources of the flutter engine would not be destroyed. Causing a out of memory crash

@vanlooverenkoen
Copy link
Contributor Author

Always double check that your callback function does not trigger a crash before the method channel is setup. This could lead to out of memory issues. becaus native code is never notified that the callback is initialized

typical setup:

Future<void> callbackHandler() async {
  _setupFlavorValues();
  await setupBackgroundDriverDependencyTree();
  BackgroundLocationTrackerManager.handleBackgroundUpdated((data) => KiwiContainer().resolve<YourRepo>().updateBackgroundLocation(data));
}

Scenario where out of memory errors would occur

Future<void> callbackHandler() async {
  _setupFlavorValues(); //throws error
  await setupBackgroundDriverDependencyTree(); //is never called
  BackgroundLocationTrackerManager.handleBackgroundUpdated((data) => KiwiContainer().resolve<YourRepo>().updateBackgroundLocation(data)); //is never called
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant