perliedman / leaflet-realtime

Put realtime data on a Leaflet map
ISC License
743 stars 167 forks source link

Memory explosion #57

Closed kputland closed 7 years ago

kputland commented 7 years ago

My data contains ~4000 - ~5000 LineString, Memory balloons until browsers crash.

I have some profiling information (timeline and two heapsnapshot) from chrome (Version 55.0.2883.95 (64-bit)) on osx. Same experience with Safari and Firefox, but the three files are 165MB compressed and I'm unable to upload.

after ~1hr of updates the browser is consuming ~10GB memory.

updates interval is 30 seconds.

I'll work on sanitizing the sources and include tomorrow.

perliedman commented 7 years ago

Hi and sorry for not getting back to you sooner. I'd try to investigate with Chrome's devtools heap profiler, it can show quite clearly what's consuming all that memory and why.

Obviously, Leaflet or Leaflet Realtime is holding on to some layer it doesn't need, but it's hard to say without seeing the actual code. Do you happen to have a running example?

kputland commented 7 years ago

@perliedman Sorry, I don't have a working example anymore. I abandoned leaflet for the time being and did my work with the google maps api.