阅读背景:

释放Javascript中未连接的DOM节点使用的内存

来源:互联网 

As part of my application, I'm putting together a set of small Dom nodes that are not shown all at once. I'm storing them in an internal array. The user can invoke their display in which case I reparent them to the div that is used to display them. That's all well and good. But when it's time to replace all of them with new ones, I want to destroy the old ones (effectively deallocate them). Otherwise, over time, memory usage could grow exponentially. How do I force the browser js engine to do this? Is just setting each of the items in my array of Dom nodes to null enough? Is there something else I have to do? Or maybe I don't have to worry about this at all?As part of my application, I'm putting together




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: