> - Is it normal that IE doesn't garbage collect DOM elements between http 
> request?

Not that I know of, but it is quite feasible that your http request is failing 
to cleanup after itself somewhere along the line.

 >  - Is there memory leak known when correclty using Prototype's Event 
mecanism ?

Between page loads? Maybe. Within a page? Certainly. stopObservers 
currently does not remove the array containing 
[element,name,observer,useCapture] that was created during the observe 
call. I have no doubt your code calls Event.observe  *many* times in 
just one page load (use Firebug's profiler to see), and this cache is 
just growing larger and larger. Even on unloadCache it just sets the 
element to null. As far as I can tell the function is still stored in 
the Event.observers array.  Also, you may think you are stopping your 
observers correctly but I have seen many people do the following:
Event.observe(element,'click',this.someFunction.bind(this));
Event.stopObserving(element,'click',this.someFunction.bind(this));
which does not work. Of course if you are getting rid of your element at 
the same time you'll never know because an error is never thrown. bind 
and bindAsEventListener return new functions with each call, so the 
arguments to observe and stopObserving above are not the same. And then 
there are all of the widgets we all love to use (like TinyMCE and SAU) 
but if they don't provide a cleanup method (usually "dispose") and you 
don't make use of it you can be sure you are leaking memory there as 
well. As Martin recently discovered there are plenty of other ways to 
leak memory, as subtle as overwriting variables (I guess inadvertently 
creating closures?). In my experience FF will consume as much memory as 
IE, maybe it's due to the plethora of extensions installed. The easiest 
solution is yet another extension, the "Restart Firefox" extension!

Colin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to