My understanding on this memory leak issue is as follows:

IE deletes items from its memory when it has no references from
anything else left
If you have a class instance such  as an autocompleter which has a
reference to a dom element, and that dom element references back to
the autocompleter, you have a catch 22 situation - they reference each
other so won't be deleted, but yet nothing else references them when
the user is viewing another page.
So the situation you mentioned isn't a problem, as long as you don't
store the autocompleter on the element.
I'm not 100% on this but that's what my knowledge on the subject is.
Of course you can use task manager to observe IE's memory (this will
only be an issue on IE) and see if repeated visits to the page
continue to increment IE's memory allowance. Andrew Dupont in his
prototype book recommends a mixin such as Trackable which statically
tracks all instances of a class, as this.constructor from within an
instance refers to the class of that instance. I won't post the code
here out of respect but it's the best approach to take.

On Sep 17, 9:00 am, Jean-Philippe Encausse <[EMAIL PROTECTED]>
wrote:
> Hi,
> I have a little neebie "design" question (more than an issue) using
> this code:
>
>     new Ajax.Autocompleter(elm,div, url, { ... });
>
> - I do not have reference to created instance and there is no
> "destructor" on autocomplete.
> - I give a DOM element to the constructor that is referenced by
> autocomplete.
>
> So the JS World have reference to the DOM world. Is it a Memory Leak
> issue ?
> And now if I add cycle référence like:
>
>     elm.autocomplete = new Ajax.Autocompleter(elm,div, url, { ... });
>
> I'm asking this question because I always thought that we should
> reference ids in javascript and use $() function.
>
> Regards,
> Jp
--~--~---------~--~----~------------~-------~--~----~
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-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to