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

Memory issue on init #5722

Closed
type-it opened this issue Jul 19, 2016 · 13 comments
Closed

Memory issue on init #5722

type-it opened this issue Jul 19, 2016 · 13 comments
Labels
Core The cross-platform C++ core, aka mbgl crash support

Comments

@type-it
Copy link

type-it commented Jul 19, 2016

Hi,
I have installed MapBox via Fabric.
When i go an trigger the init method like this

  • (void)mapBox:(UIView*)mapView
    {
    self.map = [MGLMapView new];
    [self.map setFrame:mapView.bounds];
    [self.map setCenterCoordinate:CLLocationCoordinate2DMake(40.712791, -73.997848)
    zoomLevel:12
    animated:NO];
    [mapView addSubview:self.map];
    }

it doesn't load and I get a crash like this
zrzut ekranu 2016-07-19 o 09 58 56
zrzut ekranu 2016-07-19 o 10 00 56
zrzut ekranu 2016-07-19 o 09 59 17
zrzut ekranu 2016-07-19 o 09 59 31

AppName(3849,0x16e087000) malloc: *** mach_vm_map(size=805306368) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
(lldb)

PLEASE HELP

@wanggang316
Copy link

wanggang316 commented Jul 19, 2016

Me to, couse our app 200+ crashs online, what's happened?

@Paladinfeng
Copy link

it affected me too. the memmory increase to hundreds of MB. the thread would be killed

@type-it
Copy link
Author

type-it commented Jul 19, 2016

I Found that using
pod "Mapbox-iOS-SDK", "~> 3.2.0"

Works correctly ;-)

@Paladinfeng
Copy link

the service was resumed at 7:00pm (time zone: Beijing)

@friedbunny
Copy link
Contributor

We’re investigating, thanks for your patience.

@1ec5
Copy link
Contributor

1ec5 commented Jul 19, 2016

We’re tracking the fix in #5723 and will release the fix today in v3.3.1.

@1ec5 1ec5 closed this as completed Jul 19, 2016
@HappyDr0id
Copy link

We have the same issue on our Android app since 10am (French time), do you plan to add a fix in the Android SDK too ? Is there any solution without having to update the app with a new MapBox SDK version ?

@1ec5 1ec5 added crash Core The cross-platform C++ core, aka mbgl labels Jul 19, 2016
@zugaldia
Copy link
Member

@HappyDr0id sorry to hear you're affected by this, we're working on a fix to address this problem as soon as possible. In the meanwhile, there're a couple of things you could do to mitigate this issue:

  • You could recommend your users to clear their app cache.
  • You could change the style in the app to a new style. This will invalidate the cache and load a fresh style from the server (this requires an app store submission).

@HappyDr0id
Copy link

@zugaldia Okay, thanks a lot for your answer, I will push an update on the PlayStore with a new map style. I hope that it will fix the issue. Keep up the good work !

@bsudekum
Copy link

bsudekum commented Jul 19, 2016

To add a little more clarity on who would be affected by this bug:

  • Any version of both the Mapbox iOS and Android SDKs
  • Some users who made a request for a Mapbox style between ~12:00am GMT and ~6:00am GMT today
    • Because mapbox-gl-native caches styles once fetched from the server, this most likely only affected new users fetching a style for the first time.
  • The above bullet is also why the bug occurred; a bad style was fetched from the server and cached on the users device. The map would then try to render the bad style and the app would fail.
  • Styles that could have been affected:

Like @zugaldia pointed out in #5722 (comment), the best path forward is:

  • You could recommend your users to clear their app cache (not possible on iOS)
  • You could change the style in the app to a new style. This will invalidate the cache and load a fresh style from the server (this requires an app store submission).
  • This PR will be rolled into a release today that will fix the issue.

@bleege bleege mentioned this issue Jul 19, 2016
14 tasks
@bleege
Copy link
Contributor

bleege commented Jul 19, 2016

We're releasing the PR on Android as 4.1.1 today. The release can be tracked here: #5725

@bleege
Copy link
Contributor

bleege commented Jul 19, 2016

Android 4.1.1 is now released and publicly available on Maven Central. #5725 (comment)

@1ec5
Copy link
Contributor

1ec5 commented Jul 19, 2016

The fix is now in iOS SDK v3.3.1 and macOS SDK v0.2.1 as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl crash support
Projects
None yet
Development

No branches or pull requests

9 participants