Open sumeetkpatel opened 8 years ago
I encountered a similar memory leak issue. I'm not using the bubbles
feature but I'm loading many times a wordmap via ajax (using Turbolinks).
I didn't find any way to free the allocated memory by the worldmap js library and this will cause the browser crash.
I am using the world map to plot some data in a live fashion where the bubbles update frequently and am noticing awsnap's from that page fairly frequently, upon investigation it seems every time a call is made to map.bubbles() with a new set of 'bubbles' to plot, it works but the old d3 svg nodes still remain and seem to use a fair amount of memory eventually causing the tab to be aborted (chrome).
I was able to limit the issue by removing all d3 circle nodes before adding new bubbles.
ie.
d3.selectAll("circle").remove();
beforemap.bubbles()
You can see a basic example here: Leaking example Not Leaking example
The chrome task manager can be used to observe the leak.