Re: Memory Leak IE Javascript attribute add onblur



On Oct 11, 1:30 pm, Joshua <joshuafa...@xxxxxxxxx> wrote:
On Oct 5, 1:45 pm, Joshua <joshuafa...@xxxxxxxxx> wrote:





On Oct 5, 10:02 am, Henry <rcornf...@xxxxxxxxxxxxxx> wrote:

On Oct 4, 3:38 pm, Joshua wrote:

On Oct 3, 9:41 am, Henry wrote:
<snip>
In the code behind (.cs) I'm adding onchange, onblur and
onfocus events to a bunch of objects that reside on my
page (textboxes and dropdownlist).

But what your "code behind" is doing is generating HTML and/or
client- side javascript, which is actually doing the work of
adding event handling functions to HTML elements (or causing
that work to be done, but still on the client). You (or
someone who understands it) need to be looking at the HTML
and/or javascript output from your servers and sent to the
browser to be interpreted/rendered/executed there.

After using Drip i've found that these are leaving open DOM
objects.

Does anybody know how to kill these when I exit the page?

Yes, but not in any way specific to your code. ...
<snip>
reg:

"reg"?

You handle the issue by avoiding forming such circular
references or explicitly breaking them when they are no longer
important (as the page unloads at the latest).

Do you know how to do this?

Yes, for code I can understand.

Do i just find the objects on unload and
set them to null?

Objects cannot be set to null. References to objects can be set to
null, and breaking circular chains of references usually involves
setting references to objects to null.

If so how can i find all the objects?

What objects?

Can I write a general recursive function to kill all open
circular references on unload?

Yes, but it is a very bad idea because it is very time consuming to
null all possible object references from all DOM Nodes and ActiveX
objects used (though some XML HTTP request systems would not leave the
request objects exposed so onunload cleanup would not be practical).
It is better to break only the circular references you mad in your
client-side code.

So how can you identify and kill a circular DOM reference? Any
ideas? Is there a link to something out there to some code samples?

It's funny. If I remove all the ajax toolkit items then all the open
DOM leaks go away. The calendar extender and the cascading dropdown
items create circular DOM references.

And they don't break them on unload? If not, they are poorly written
widgets and you should stop using them.


Ajax is pretty, but always seems to cause more problems than it's
worth.

Your problem has nothing to do with Ajax. You are confusing Ajax with
DOM manipulation.


.



Relevant Pages

  • Re: menus in JS or CSS - pros? cons?
    ... So in theory, attaching event handlers to ... The theory that says 'all circular references including DOM nodes causes ... but it does not identify all leak scenarios. ...
    (comp.lang.javascript)
  • Re: Menus Vs Ajax Conundrum
    ... which references just one of the menu items with child ... VS2005, AJAX 1.1, Menu With Child Items Inside UpdatePanel. ... if I cause an async request anywhere on the page then quickly ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Add and object or a function?
    ... Closures produce less obvious circular references, ... produce a circular reference (The ID causes a global property to refer ... No. 'Better' cannot be reasonably assessed without a context to provide ...
    (comp.lang.javascript)
  • Re: IDE dies during compile
    ... > fairly sure there are no circular references or EVERYONE would be having ... Yeah everyones cpu spikes/bursts for this kind of request, i was more interested in sustained ... If it falls over before it even hits ...
    (microsoft.public.dotnet.languages.vb)
  • Cant access System.Web.Extensions
    ... I have a site which was a .NET 2.0 AJAX 1.0 site. ... my references to AJAX no longer work. ... Unknown server tag 'asp:scriptmanagerproxy'. ... I have tried adding the System.Web.Extensions to the global namespace import ...
    (microsoft.public.dotnet.framework.aspnet)