-
Notifications
You must be signed in to change notification settings - Fork 32
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
Possible memory leak ? #49
Comments
I think that problem might come from the upstream repo, which is not fully removing the glify instances. (see this issue) |
Thanks for the reply. |
If those are the only polygons you are plotting, you could remove the instances yourself with In the ui you need to include |
Thanks @trafficonese for chiming in here. I have sent you an invite with write access to this repo. I figure you're contributing so much here, you might as well have write access... |
Wow thank you very much @trafficonese ! edit : here is the solution
|
I would keep this issue open as this is more of a dirty hack than a proper fix. If multiple layers are included and the one to be removed is not the first in the array, the solution will not work. So, I think this should actually be handled in the underlying library. Thanks @tim-salabim, I really appreciate it! |
Hey all,
Neither seem to solve the problem - just wondering if there is an updated workaround or alternative that I can consider? |
The issue is documented here robertleeplummerjr/Leaflet.glify#129 (comment) I just pushed a PR to the upstream repo to address it. robertleeplummerjr/Leaflet.glify#153 (comment) In my opinion this is currently the biggest issue for using the library in an interactive context (e.g. Shiny), where one needs to remove/update a layer many times. Otherwise we just add new WebGL contexts and at some point the browser will tell us that the oldest WebGL contexts are lost and the old layers are gone.. ❗ When this gets merged and we add it here, the old workaround using Also @tim-salabim, since you updated to the new Leaflet.glify version (which btw. is not registered in Github as a release ❓ ), we should expose the methods I will try to find some time at the end of this week to open a new PR, if thats ok with you? |
Thanks @trafficonese ! That's fine. I'll take a look at your PR as soon as it's ready |
Hi,
First of all, thank you for this great package !
I want to use
leafgl
to display a large shapefile (~35000 polygons) in Shiny.The user can choose a variable to map and the map is updated through
leafletProxy
.However, I notice that memory usage increase each time the user choose a new variable, here is a reproductible example.
Each time I click
go
button, memory increase by about 100Mo.The text was updated successfully, but these errors were encountered: