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

Memory leak with V3.0.0 iOS SDK #3130

Closed

Description

@Dwar3xwar

I've noticed a memory leak while using MGLMapView within a navigation controller.

To Recreate:

  1. Create 2 view controllers in a navigation controller, with VC A segueing to VC B, containing a MGLMapView.
  2. Go back to the original view controller, VC B is deinitialized but memory is not freed at all.

Instruments:

screen shot 2015-11-25 at 3 09 10 pm

Activity

  1. added
    iOS
    performance
    on Nov 25, 2015
  2. 1ec5 commented on Nov 25, 2015

    @1ec5
    Contributor

    @adam-mapbox, SpriteAtlas is being leaked. Would #3049 address this issue?

  3. fezzik21 commented on Nov 25, 2015

    @fezzik21

    I'm not sure. If anything, https://github.com/mapbox/mapbox-gl-native/compare/tmpsantos-1488_annotations_survive_style_change would perhaps fix it; but I think that only deals with leaking the SpriteAtlas that was created for that PR. So it wouldn't fix existing issues. It makes me think though that something very similar to what @tmpsantos fixed for #3049 is going on here.

  4. syedhali commented on Dec 4, 2015

    @syedhali

    Hey guys, I'm also experiencing this (just updated from 2.1.2 to 3.0.0). Really love the release, but we've rolled back our app to 2.1.2 because the leak is too large for now.

  5. 1ec5 commented on Dec 4, 2015

    @1ec5
    Contributor

    Any idea what could’ve caused this @jfirebaugh? If not, I can bisect later today.

  6. added this to the ios-v3.1.0 milestone on Dec 4, 2015
  7. changed the title [-]Memory Leak with V3.0.0 iOS SDK[/-] [+]SpriteAtlas leak with V3.0.0 iOS SDK[/+] on Dec 4, 2015
  8. jfirebaugh commented on Dec 4, 2015

    @jfirebaugh
    Contributor

    Please do. I don't immediately see any issues in the code.

  9. changed the title [-]SpriteAtlas leak with V3.0.0 iOS SDK[/-] [+]Memory leak with V3.0.0 iOS SDK[/+] on Dec 9, 2015
  10. jfirebaugh commented on Dec 9, 2015

    @jfirebaugh
    Contributor

    I suspect that SpriteAtlas is a symptom of a larger, parent object being leaked.

  11. jfirebaugh commented on Dec 14, 2015

    @jfirebaugh
    Contributor

    #3204 has a test app.

  12. self-assigned this
    on Dec 18, 2015
  13. sebyddd commented on Dec 18, 2015

    @sebyddd

    Experiencing the same issue. Tried all obvious fixes I would think off. Deallocation, autorelease pool, singleton instance, but still nothing.

  14. 17 remaining items

  15. ultranano commented on Jan 25, 2016

    @ultranano

    Great @1ec5!
    How I can update the prerelase with cocoapods?

  16. 1ec5 commented on Jan 25, 2016

    @1ec5
    Contributor

    To install this weekend's prerelease via CocoaPods, point your Podfile to this Podspec. Note that, if you use Swift, you may run into #3300, which will be fixed in the next prerelease.

  17. chriszhang4213 commented on Jan 26, 2016

    @chriszhang4213

    is that possible we can get a static binary release for 3.1 soon? looks like 3.01 has a huge memory leak whenever i use the map in my app, and it is not convince for us to use the CocoaPods since we don't want to make a lot of change for some other old sdk in CocoaPods,

  18. friedbunny commented on Jan 26, 2016

    @friedbunny
    Contributor

    Have a look at the releases page for links to (pre-)release binaries.

  19. chriszhang4213 commented on Jan 26, 2016

    @chriszhang4213

    @friedbunny I am now using the mapbox-ios-sdk-3.0.1-no-bitcode.zip version now, i did download the pre-release version trying to use that in our test project. just wonder if you guys can have a same kind of 3.1 no-bitcode version release soon

  20. 1ec5 commented on Jan 26, 2016

    @1ec5
    Contributor

    @chriszhang4213, you can obtain a Bitcode-free binary by building from source (make ipackage BITCODE=NO). I’m curious what’s preventing you from adopting Bitcode in your project. Is it a particular third-party framework, perhaps, or iOS 7 support?

  21. chriszhang4213 commented on Jan 26, 2016

    @chriszhang4213

    @1ec5 @friedbunny . ok, we did use some third-party framework. I am new in this part. when I download the 3.01 I follow the guide https://www.mapbox.com/ios-sdk/#binary which is working fine on my project. then I feel like you guys didn't put new release on that download link, so i went to the Pre-release 3.1 and download the dynamic framework instead of a static library. follow the read me.txt guide ...trying to make this work in my testing project.

    then it shows #import "Mapbox.h" file not found...


    never mind, i just figure out i should use #import < Mapbox/Mapbox.h > instead of "Mapbox.h", it works now..

  22. 1ec5 commented on Jan 27, 2016

    @1ec5
    Contributor

    @chriszhang4213, please note that 3.1.0-pre.1 is a prerelease – we’re still readying it for a final release that’ll come out soon. We’ll update the guide at that time.

  23. nzhuk commented on Feb 1, 2016

    @nzhuk

    Thanks for fixing the issue. Current pre-release version seems to be ios-v3.1.0-pre.3. Do you have some estimate of when we could expect 3.1.0 final release?

  24. ultranano commented on Feb 5, 2016

    @ultranano

    Hi All! I see that for milestone 3.1 there is only one issue on going.
    Do you have an estimate date for final release 3.1?

  25. 1ec5 commented on Feb 8, 2016

    @1ec5
    Contributor

    Version 3.1.0 is out. CocoaPods has been updated, and the online installation instructions have been updated for anyone installing manually. Thanks for your patience everyone!

  26. jasonlosito commented on Nov 14, 2016

    @jasonlosito

    I am using the latest Mapbox iOS SDK and I am still experiencing memory leaks. I have a table where you can select a location and when you tap on item, it will go to a map to display the location. When I go back and forth, the memory keeps adding up and my app crashes.

  27. 1ec5 commented on Nov 14, 2016

    @1ec5
    Contributor

    @jasonlosito, it's likely that the memory leak you're experiencing is distinct from the issue that was reported here and long ago fixed. Please open a new issue, and be sure to link to an instruments trace and/or sample code that reproduces the problem, so we can be sure we're looking at the same thing as you are. Thank you!

  28. karlobutorac commented on Feb 8, 2017

    @karlobutorac

    I'm having this exact same problem as Dwar3xwar:

    1. Create 2 view controllers in a navigation controller, with VC A segueing to VC B, containing a MGLMapView.
      2.Go back to the original view controller, VC B is deinitialized but memory is not freed at all.
      // The used memory gets around 50-70 mb bigger every time I switch between viewControllers
      I'm on the newest version
  29. 1ec5 commented on Feb 8, 2017

    @1ec5
    Contributor

    Tracking in #7991.

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

Metadata

Metadata

Assignees

Labels

bugiOSperformance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions