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

Fix out-of-memory crashes on iOS when creating maps #467

Merged
merged 8 commits into from Jan 12, 2017

Conversation

Projects
None yet
5 participants
@hartez
Member

hartez commented Oct 18, 2016

Description of Change

On iOS 10, constructing a new map view leaks memory; after constructing a sufficient number of them, the app will be ejected for memory use. This change pools instances of MKMapView on iOS 10, reusing them to reduce the number of instances created and minimize the leaked memory.

This change also cleans up the Dispose implementations for MapRenderer, ViewRenderer, and MapDelegate to make them more consistent and to avoid some other minor leaks.

  • Pool map views on iOS 10 to avoid memory issues
  • Clean up disposal implementation for iOS map renderer, view renderer, and map delegate

Bugs Fixed

API Changes

None

Behavioral Changes

None

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
@jassmith

This comment has been minimized.

Show comment
Hide comment
@jassmith

jassmith Oct 20, 2016

Member

Merge when tests pass

Member

jassmith commented Oct 20, 2016

Merge when tests pass

hartez added some commits Oct 6, 2016

Pool map views on iOS 10 to avoid memory issues
Clean up disposal implementation for map renderer, delegate
if (e.NewElement != null)
{
SetAspect();
SetImage(e.OldElement);

This comment has been minimized.

@rmarinho

rmarinho Dec 15, 2016

Member

e.OldElement?

@rmarinho

rmarinho Dec 15, 2016

Member

e.OldElement?

@rmarinho

This comment has been minimized.

Show comment
Hide comment
@rmarinho

rmarinho Jan 4, 2017

Member

@hartez can you check why it's failing on iOS9 ?

Member

rmarinho commented Jan 4, 2017

@hartez can you check why it's failing on iOS9 ?

@jassmith jassmith merged commit ba7b66b into master Jan 12, 2017

4 of 5 checks passed

iOS9-UITests-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle 8 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS9 : Tests failed: 1, …
Details
OSX-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle 8 :: OSX Debug : Running
Details
Windows-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle 8 :: Windows Debug : Tests passed: 3685, ignored: 10
Details
iOS10-UITests-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle 8 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS10 : Tests passed: 34…
Details
iOS8-UITests-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle 8 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified IOS8 : Tests passed: 345…
Details

@hartez hartez deleted the fix-bugzilla39489_ios branch May 16, 2017

@hartez hartez referenced this pull request Nov 11, 2017

Merged

[iOS] Disable iOS Map pooling; Add null check #1265

3 of 4 tasks complete

@samhouts samhouts added this to the 2.3.4 milestone Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment