There are times when setTimeout can cause a memory leak ... see the following article: setTimeout memory leaks
Be warned that IEx has the fineness of garbage collection; I think if you refer to the DOM variable in Javascript closure, then the collection mechanism gets confused, and at the end of the request it does not break, and in the end it becomes a memory leak. I think this is because the DOM variables and JS internal variables are collected by two different collectors, and they do not report correctly that they are no longer used.
I think you can fix this by setting the variable to null:
setTimeout(function(){ myFunction(parameter); parameter = null }, myTimeout);
This clearly sets the garbage collection in motion.
crazyDiamond
source share