Mapbox-gl-js: Destroy gl buffers after calling Source#reload

Created on 15 Mar 2016  Â·  4Comments  Â·  Source: mapbox/mapbox-gl-js

mapbox-gl-js version: 0.15.0

Steps to Trigger Behavior

  1. map.style.sources[vectorTileSourceName].reload()

    Expected Behavior

The GL buffers from the old buckets are destroyed.

Actual Behavior

The GL buffers from the old buckets are not destroyed.

When vector tiles are reloaded, only loadVectorData is called. The existing buckets and their gl buffers are never destroyed
https://github.com/mapbox/mapbox-gl-js/blob/2b809ddaf3be1547dd485a2d968f0cc9efbf4fd1/js/source/vector_tile_source.js#L74-L100

good first issue performance

Most helpful comment

Any progress on this? We are having issues with Mapbox-gl-js on iOS. Even after completely removing the script, and adding the script back in, we are seeing the error:
Terminated due to memory error.
After loading mapbox about 5 times.

We've tried everything from using the mapboxgl.remove(), to removing script and reloading dynamically for every map creation.

All 4 comments

Any progress on this? We are having issues with Mapbox-gl-js on iOS. Even after completely removing the script, and adding the script back in, we are seeing the error:
Terminated due to memory error.
After loading mapbox about 5 times.

We've tried everything from using the mapboxgl.remove(), to removing script and reloading dynamically for every map creation.

@ansis Have you solved this problem? I also have this problem when call geojson source setData().

@lucaswoj How to destory the GL buffers from the old buckets? Can you give me some advice?
Thanks very much.

memory
memory2

Was this page helpful?
0 / 5 - 0 ratings