On Oct 25, 9:40 pm, Paco Gómez <pacogomezgrana...@gmail.com> wrote:
> Hi TJ,
>
> I'm Jose's partner. The thing I don't understand is why we can recover
> memory after creating any other kind of object, but not with DOM
> elements.

I don't see the issue in either Firefox or IE 6.

[...]
> Do you have any idea why is this happening? I believe that if we at
> least can free this nodes in this simple example we could understand
> why they are not being freed in our big application.
> I'm guessing that it could be related to:
> - Something in the initialize of element class (we add the element to
> some cache)
> - Something in the insert method
> - References that are being stored in each element (to its parent and
> child nodes) make it impossible for IE to remove them from memory.

Easy to test: use plain DOM instead and see if you get the same
result.

Here's an example:

function doTest(n) {
  var elementArray = [];
  while (n--) {
    elementArray[n] = document.createElement('div').
                      appendChild(document.createTextNode('test
text'));
  }
  alert('Before destroy');
  elementArray.length = 0;
  alert('After destroy');
}
doTest(3000);


Incidentally, the above uses very little memory and is 10 to 40 times
faster, so you can see that Class.create() is a very inefficient
factory.


--
Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to