javascript - Using d3 transitions causes memory leak -
I d3.js. Created the scene with the help of. Visualization uses a lot of changes (like show / hide / move element) I saw a high CPU load and a large increase in memory over time, after some time the visualization made very slow.
So I removed the change, or replaced it with a self-made transition function with a slow frame - evaluate. Unfortunately, deleting all infections is not an option because this will give less visualization to the presentation. The rest is the transit circle which is increasing / decreasing the circle radius.
Still the memory leak seemed, mostly appearing in Chrome (20,000 windows task manager between 10 minutes).
So I wonder if it can happen that the transition itself is causing the memory leak. To check this, I have created a JSWDB to see if a similar change will show results alone. And it does: When running in Chrome, memory increases to 9,500 per 10 minutes (depending on Windows Task Manager).
g_svg = d3.select ("# visualization"). ("SVG") .attr ("width", 300) .attr ("height", 300); Circle = g_svg.append ("circle") .attr ("cx", 150) .attr ("cy", 150) .attr ("r", 0). Style ("Opacity", 0.3). Style ("fill", "orange"); Resize (); Function size () {circle.transition () .duration (500) .attr ("r", 100) .transition () .delay (750) .duration (500) .attr ("r", 0) var t = SetTimeout (function () {resize ()}, 1500); }
Is it possible that D3 transition is increasing itself in memory usage? Or am I wrongfully using D3 transition?
I'm looking at Chrome Dev Dev but it is not really helping me:
- Find out from the Hep Timeline It turns out that most of the (array) and (compiled code) objects are increasing and the maximum size is maintained whenever I open them, there were too many things I do not understand the items shown in the profiler, but the profiler.
- In addition, spike (which is probably due to infection) on the timeline of the pile is getting faster over time.
- Stack snapshot size does not increase in size, but when comparing objects allocated between snapshots, I do not see the same (array) and (it does not seem to be related to D3
JS but on chrome (38) over windows for more than an hour Bella is running and the memory usage measured in Windows Task Manager is 56 m to 133 m on another browser (for example IE 10) the same fleet will not be above , But approximately 37m is left.
Comments
Post a Comment