Nativescript Mapbox on iOS retain memory after navigation away
See original GitHub issueI’m using Angular 2, with router-outlet navigation. My app is killed by the OS for using too much memory after I navigate away from the page with the MapBox map and return. It’s clear that the memory associated with the Mapbox instance is not being released.
I put a log statement in ngOnDestroy() and it is being called when I expect it to be. Is there anything I can do to force the SDK to release memory?
I’m instantiating the map via XML
<GridLayout #mapcontentview rows="*" columns="*" >
<Mapbox
accessToken=MYTOKEN
latitude="39.9780"
longitude="-82.4182"
zoomLevel="12"
showUserLocation="true"
(mapReady)="onMapReady($event)">
</Mapbox>
</GridLayout>
This component is instantiated in the page via Angular2 router-outlet navigation.
How can I further debug this issue?
Issue Analytics
- State:
- Created 7 years ago
- Comments:27
Top Results From Across the Web
Reduce Memory Usage Reference - Mapbox docs
Then, the user initiates navigation and the NavigationViewController is presented. However, the preview map is longer necessary to keep around in memory.
Read more >nativescript-mapbox/mapbox.ios.ts at master - GitHub
// tried to init the map. private initCountHack : number = 50;.
Read more >ios - Memory get increase but not release on dismiss [Mapbox]
I am using MapBox for navigation in my app. ... At this moment my memory get increase 180mb, after get dismiss from controller...
Read more >Using A Mapbox In A NativeScript Angular Application
We're going to see how to include Mapbox in our NativeScript Android and iOS mobile application using Angular and TypeScript.
Read more >nativescript-mapbox
$ npm install --save nativescript-mapbox · cd src npm run build. · cd src npm run build. · <service android:name="com.mapbox. · <Page xmlns="http://schemas....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for sharing, @simonettoa!
I’m about to release plugin version 4.0.0 which includes Mapbox iOS SDK version 4.0.0 which (as far as I can see from their changelog) contains a bunch of memory leaks. Perhaps that will help as well. Closing for now.
With the above referenced test app.
I do a GC on ngInit … I’m loosing only 5MB on a round trip. This is a big improvement over ~350MB I was loosing.
It is probably good enough for our application. But not for a full scale (web scale) production app.
I don’t think you should close this issue.