Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Adds tests and potential fixes for #10771 and #11143 #11291

Closed
wants to merge 5 commits into from

Conversation

akitchen
Copy link
Contributor

@akitchen akitchen commented Feb 23, 2018

Unfortunately a brief spin of the run loop is required for some of these tests; we should take a critical look at which ones are worth keeping around once we're satisfied with the fixes they are helping to drive, in order to avoid slowing down our test suite too much.

/ref #10771 #11143
/cc @asheemmamoowala @julianrex @1ec5 @lilykaiser

Unfortunately a brief spin of the run loop is required for the layer reuse test. I've tried to tune this down for my machine; YMMV
@akitchen akitchen added iOS Mapbox Maps SDK for iOS ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels Feb 23, 2018
@julianrex
Copy link
Contributor

@asheemmamoowala @julianrex I have a potential fix for these errors (and integration tests not running) at gl-layer-memory-fix...jrex-gl-layer-memory-fix.

All the tests run, and I played with the iOS app for a while and all seemed good, but obviously this could have some significant impact, and there may be other cases that I haven't considered.

Can you take a look? If it looks good, we could merge into master, and then cherry-pick into boba?

To get the tests to run on device, I had to add Mapbox.framework to the test app as an embedded framework (rather than adding it to the integration framework).

@julianrex
Copy link
Contributor

Added a PR into your branch @akitchen.

@akitchen akitchen changed the title Adds failing tests for #10771 and #11143 Adds tests and potential fixes for #10771 and #11143 Feb 26, 2018
@akitchen akitchen removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Feb 26, 2018
@akitchen
Copy link
Contributor Author

@jmkiley do you have a working example which we could use to verify these fixes? I thought maybe you did, from your previous investigations...


// Pair the retain above, and release self, since we're now removed from the collection
CFTypeRef toRelease = (__bridge CFTypeRef)self;
CFBridgingRelease(toRelease);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I'm wondering - is this guaranteed to happen, always? Or do we need more of a dance to ensure this is released if the whole style is destroyed without an explicit call to -removeFromStyle:...

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe so, when the style gets cleaned up. But we should add a test for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Scratch that - I think we need some more clean-up.

@jmkiley
Copy link
Contributor

jmkiley commented Feb 26, 2018

I used this branch with my repro branch and it seemed to be 👍

@akitchen akitchen added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Feb 27, 2018
// this is because although the layer has been removed from the style, there's still a pending
// render (deinitialize) call, that will needs to be handled, which will finally release the
// layer (and then the layer will be dealloc'd when the autorelease pool drains)
[[NSRunLoop currentRunLoop] runUntilDate:[[NSDate date] dateByAddingTimeInterval:waitInterval]];
Copy link
Contributor

Choose a reason for hiding this comment

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

If we expect the layer to be released as of the next render, how about putting in an expectation that gets satisfied upon the next call to -[MGLMapViewDelegate mapViewDidFinishRenderingFrame:fullyRendered:]?

@asheemmamoowala
Copy link
Contributor

Incorporated into: #11553

@akitchen
Copy link
Contributor Author

akitchen commented Apr 3, 2018

I believe this can be closed now that #11553 has landed... please reopen if I'm mistaken.

@akitchen akitchen closed this Apr 3, 2018
@jfirebaugh jfirebaugh deleted the gl-layer-memory-fix branch July 27, 2018 22:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants