-
-
Notifications
You must be signed in to change notification settings - Fork 768
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 leak on map.remove() #4811
Comments
Thanks for taking the time to report this issue! |
There's also this report, which has a root cause investigated already: |
@HarelM Hey, I've already fixed mapbox/mapbox-gl-js#13110 Not aware of maplibre code yet, so I'm just guessing and throwing ideas. |
I can't look at the linked code since I don't want to infringe copyright laws, but you are more than welcome to tackle the memory leak in this lib. |
I've opened a PR to fix the relevant memory leak I observed using chrome devtools. |
hello,
I have a website where several pages contain a maplibre map. It's a SPA so maplibre-gl.js is not unloaded/reloaded for each map. Maps are created and destroyed over the navigation.
I have issues with memory consumption which increase each time i create and then destroy a map.
My work is based on maplibre 4.1 but i have also tested with maplibre 4.7.1 and the issue is the same (may be a little better with 4.7.1)
maplibre-gl-js version: 4.7.1
browser: Chrome 128 / linux
Steps to Trigger Behavior
Link to Demonstration
I have wrote a sample code to reproduce my problem :
https://output.jsbin.com/vumugiroma
Each time you press 'space' key you create or destroy a map.
The total used memory increase at each time (Check with Chrome task manager or memory in Devtools)
Expected Behavior
Don't increase memory consumption after several creation and destruction of maps.
Actual Behavior
Some objects are not released
The text was updated successfully, but these errors were encountered: