Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do any web browsers garbage collect removed dom elements? (as opposed to Javascript objects)

If one made a web application that never refreshed a page but was built completely from the first page plus Javascript requests, thereby creating and destroying elements as required, would any of the browsers reuse the memory used by the obsolete dom elements?

Is this planned in any browsers yet?

I'm thinking that full blown extJS apps would be very sensitive to this kind of memory leakage.

Is there any truly effective re-use strategy to mitigate this problem?

I'm not referring to Javascript object garbage collection here, only removed DOM elements, but I'm not sure if that is essentially the same thing in the end.

like image 585
barrymac Avatar asked Nov 13 '22 14:11

barrymac


1 Answers

It looks like Chrome does this: http://jsfiddle.net/GaPLT/1/.

Memory usage:

  1. Start: 45K
  2. After adding: 60K
  3. After removing: 49K
like image 104
pimvdb Avatar answered Dec 22 '22 00:12

pimvdb