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

Memory usage increases even after map.remove() #3264

Closed
jnorris441 opened this issue Sep 27, 2016 · 5 comments · Fixed by #7042
Closed

Memory usage increases even after map.remove() #3264

jnorris441 opened this issue Sep 27, 2016 · 5 comments · Fixed by #7042

Comments

@jnorris441
Copy link

jnorris441 commented Sep 27, 2016

v0.24.0:

Steps to Trigger Behavior

  1. Create a map
  2. remove the map with map.remove()
  3. repeat many times, memory usage will continue to increase

This fiddle loads a map and lets you reload it. Watch the heap as you reload a bunch of times:
https://jsfiddle.net/jnorris441/24rgc7L4/2/

Screenshot after 10 reloads http://i.imgur.com/76PZUXb.png

Expected Behavior

map.remove() should hopefully release memory and let you create maps indefinitely

Actual Behavior

Memory usage increases. Not a huge deal on a desktop but this crashes tabs on mobile Safari and Chrome on Android after a few reloads.

@mourner mourner added the performance ⚡ Speed, stability, CPU usage, memory usage, or power usage label Sep 28, 2016
@wandergis
Copy link
Contributor

I have confused with this problem for a long time. #2607 #3095

@jfirebaugh jfirebaugh added bug 🐞 and removed performance ⚡ Speed, stability, CPU usage, memory usage, or power usage labels Feb 9, 2017
@jfirebaugh
Copy link
Contributor

Found a couple obvious leaks, but even after fixing those, repeatedly removing and recreating the map causes the heap to grow.

Heap profiler shows the growth is all in "System Objects":

image

Timeline shows Nodes and Listeners growing over time, but I can't find any evidence of that in the profiles:

image

@INRIX-Jonny-Sooter
Copy link

+1 this issue is still unresolved more than a year later. Map.remove() sure sounds like a silver bullet, but the heap continues to grow. This causes mobile devices to sure crash.

@Mariusun
Copy link

Update, Mapbox v0.44.2: This issue seems to be fixed in Chrome, but not in Safari (v11.1) or Firefox (v59.0.2).

@aryzing
Copy link

aryzing commented Apr 4, 2019

I'm using Mapbox GL through react-map-gl, and I'm experiencing heavy memory leaks. Even calling remove() does not clear up memory.

Versions used:

  • Mapbox GL: 0.53.0
  • React Map GL: 4.1.1

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

Successfully merging a pull request may close this issue.

7 participants