Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin consumers a lot of memory #50

Open
Ken473 opened this issue Sep 17, 2016 · 8 comments
Open

The plugin consumers a lot of memory #50

Ken473 opened this issue Sep 17, 2016 · 8 comments

Comments

@Ken473
Copy link

Ken473 commented Sep 17, 2016

No description provided.

@EddyVerbruggen
Copy link
Contributor

In what sense? On which platform? Can you provide a log?

@Ken473
Copy link
Author

Ken473 commented Sep 20, 2016

Hi,
Sorry for my delayed response. and I do not have a log available.
My test device is a Galaxy S4 with Android 4.4.2.
I am running Cordova 4.0 with the default Webview.
I looked deeper into the issue. It affects Android only.
My app crashes because it takes too much memory.
What happens is when a user has been working with the app for a while, and then tries to use the Social Sharing Plugin, the app simply crashes.
I have been looking at the memory consumption in the Android application manager and the app can consume up to 600 MB of RAM.
To help with the memory consumption I have disabled all the unnecessary plugins but still, the app takes a lot of data.
My device manages to hold but I cannot expect lower end devices to hold very long before they crash.

I hope I have given you enough information.

@Ken473 Ken473 changed the title The plugin clashes with the SocialShare plugin. The plugin consumers a lot of memory Sep 20, 2016
@EddyVerbruggen
Copy link
Contributor

Interesting. Perhaps it depends on how you use the plugin, so can you share the code that leads to high memory usage?

@lbweb
Copy link

lbweb commented Oct 13, 2016

Hi There,
I am also getting large amounts of memory usage when showing/hiding the map (based on when a particular tab is selected. The map is adding an additional 20MB each time I call the show() method. This is expected I guess, but shouldn't the memory be deleted when I call map.hide()? Or this there another method to remove the memory being used?

@Anothar @frigon @EddyVerbruggen - Have you experienced anything like this with the plugin?

@Ken473
Copy link
Author

Ken473 commented Dec 22, 2016

Hi @EddyVerbruggen, sorry for my late reply. There is no specific code per se that create the memory usage. Basically just running the map would increase the memory usage of the app until it crashes.

@cusspvz
Copy link
Contributor

cusspvz commented Dec 28, 2016

@lbweb do you wait for the .hide callback before calling .show again?

@dtaalbers
Copy link

dtaalbers commented Aug 23, 2017

@cusspvz @EddyVerbruggen I am getting app crashes when using this plugin in my ionic (v2) project. These crashes occur both on android and iOS, though IOS spat out the following error when it crashed:

Message from debugger: Terminated due to memory issue

I use the show() function when entering the page (ionViewWillEnter lifecycle) and the hide() when leaving the page (ionViewWillLeave lifecycle). But after navigating, to and from the map view, a few times (amount differs per device) the app just crashes. Note that navigating does not happen in a spammy way. Some indications below:

LG G3 S - Android 5.0.2 :: crashes in about 5 times
iPhone 5s - iOS 10.3.3 :: crashes in about 9 times
iPhone 6s Plus - iOS 10.3.3 :: crashes in about 12 times

After monitoring the memory on the iPhone 6s Plus while navigating to and from the page its builds up the memory to the point it crashes, from 30 MB to 1 GB on the moment the app crashes.

@dagatsoin
Copy link

dagatsoin commented Aug 24, 2017

It is a bug of the mapbox plugin used in this master branch version. I know that v4 fixed this, but I don't know if there is a minor update for 3.x.

  • Maybe you can fork this repo and set the Mapbox dependencies to 3.x (don't know which version exaclty) in src/android/mapbox.gradle
  • On iOS I am not sure where it has to be done.

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

No branches or pull requests

6 participants