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

Internal Memory Leaks in Mapbox SDK 6.2.0 #486

Open
pappalar opened this issue Sep 29, 2020 · 6 comments
Open

Internal Memory Leaks in Mapbox SDK 6.2.0 #486

pappalar opened this issue Sep 29, 2020 · 6 comments

Comments

@pappalar
Copy link

Hello, while working on my app I checked leaks and I found these ones related to internal of Mapbox.
Are you aware of those?

STACK OF 1 INSTANCE OF 'ROOT LEAK: <std>':
6   libsystem_pthread.dylib               0x1f8c0b788 thread_start + 8
5   libsystem_pthread.dylib               0x1f8c02ca8 _pthread_start + 320
4   Mapbox                                0x10a1a85e8 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::MultiDatabaseFileSourceThread>::Thread<std::__1::tuple<std::__1::shared_ptr<mbgl::FileSource>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(std::__1::function<void ()>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::tuple<std::__1::shared_ptr<mbgl::FileSource>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&&)::'lambda'()> >(void*) + 44
3   Mapbox                                0x10a1a8684 mbgl::util::Thread<mbgl::MultiDatabaseFileSourceThread>::Thread<std::__1::tuple<std::__1::shared_ptr<mbgl::FileSource>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(std::__1::function<void ()>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::tuple<std::__1::shared_ptr<mbgl::FileSource>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&&)::'lambda'()::operator()() + 88
2   Mapbox                                0x10a01a850 mbgl::util::RunLoop::RunLoop(mbgl::util::RunLoop::Type) + 192
1   libc++abi.dylib                       0x1c582db74 operator new(unsigned long) + 32
0   libsystem_malloc.dylib                0x1c06f67f8 _malloc_zone_malloc + 152
====
    1 (48 bytes) ROOT LEAK: <std::__1::__function::__func<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>, std::__1::allocator<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*> >, void ()> 0x118b197b0> [48]
STACK OF 1 INSTANCE OF 'ROOT LEAK: <std>':
6   libsystem_pthread.dylib               0x1f8c0b788 thread_start + 8
5   libsystem_pthread.dylib               0x1f8c02ca8 _pthread_start + 320
4   Mapbox                                0x10a050670 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mbgl::util::Thread<mbgl::OnlineFileSourceThread>::Thread<std::__1::tuple<> >(std::__1::function<void ()>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::tuple<>&&)::'lambda'()> >(void*) + 56
3   Mapbox                                0x10a0507c8 mbgl::util::Thread<mbgl::OnlineFileSourceThread>::Thread<std::__1::tuple<> >(std::__1::function<void ()>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::tuple<>&&)::'lambda'()::operator()() + 136
2   Mapbox                                0x10a050964 mbgl::OnlineFileSourceThread::OnlineFileSourceThread() + 192
1   libc++abi.dylib                       0x1c582db74 operator new(unsigned long) + 32
0   libsystem_malloc.dylib                0x1c06f67f8 _malloc_zone_malloc + 152
====
    1 (48 bytes) ROOT LEAK: <std::__1::__function::__func<std::__1::__bind<void (mbgl::OnlineFileSourceThread::*)(), mbgl::OnlineFileSourceThread*>, std::__1::allocator<std::__1::__bind<void (mbgl::OnlineFileSourceThread::*)(), mbgl::OnlineFileSourceThread*> >, void ()> 0x118c0a560> [48]

Steps to reproduce

  1. Load a Map
  2. Capture the memory graph
  3. use leaks to verify there are no leaks

Expected behavior

  • there are no leaks

Actual behavior

  • Mapbox SDK is leaking

Configuration

Mapbox SDK versions: 6.2.0
iOS/macOS versions: 14.1
Device/simulator models: Iphone 11
Xcode version: 12.0.1 (12A7300)

@pappalar
Copy link
Author

Screenshot 2020-09-29 at 18 23 41

@captainbarbosa
Copy link
Contributor

Hi @racer1988, can you confirm if this occurs with just a plain MGLMapView setup, or are you doing any additional work with the map view?

@pappalar
Copy link
Author

This happens as soon as the map view is initialized.
I have a custom style.

However I don't see any connection between my style or layers/sources and the one reported.

I also don't have any offlining/caching running in this example

@captainbarbosa
Copy link
Contributor

@racer1988 do you see this issue with the default styles? If not, then we may need to have a look out the style you're using, if possible. If you're able to, it would be helpful to link the the style you're working with. You can message us privately here with the style information if you'd like, just please make sure to link to this ticket if you end up doing so.

@pappalar
Copy link
Author

pappalar commented Oct 2, 2020

@captainbarbosa I will try to test the basse style on monday

@aodhol
Copy link

aodhol commented Oct 10, 2020

I'm seeing consumption of ~200MB of RAM when using a simple MGLMapView and CPU ramps up to 100%+ making the App unresponsive...with and without setting a style.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants