From: Raymond I. <xw...@ya...> - 2003-07-28 15:53:04
|
Hi Jeremy, This should fix the error. Make the change to the dynlayer_base.js file. p._destroyAllChildren = function() { for (var i=0;i<this.children.length;i++) { this.children[i]._destroy(); delete this.children[i]; } this.children.length=0; }; It's very strange I don't see a memory leak with the following examples: dynapi.api.dynlayer-destroy.html speedtest.dynlayer-deep_nest.html It seems that the ModWindow object is not doing something right. I don't understand why. Does anyone have any idea or solution? -- Raymond Irving --- Jeremy Wanamaker <je...@ma...> wrote: > I've attached a sample of my code which causes the > error for me in IE 6. In > my code, I have called 2 instances of my ModWindow > widget. If I only call > one instance, I don't get the error, but with two it > shows up. I believe it > may have to do with _destroy being called when the > 'unload' event fires. > Could it be that the _destroy function is unable to > finish before the page > is unloaded, thereby causing some object references > to be lost? This would > explain the memory leak. > > Jeremy Wanamaker > > ----- Original Message ----- > From: "Raymond Irving" <xw...@ya...> > To: <dyn...@li...> > Cc: <je...@ma...> > Sent: Friday, July 25, 2003 6:18 PM > Subject: Re: [Dynapi-Dev] memory leak > > > > > > Could you please supply an example showing this > error? > > > > I think this has something to do with the > ._destroy() > > function > > > > -- > > Raymond Irving > > > > > > --- Jeremy Wanamaker <je...@ma...> > wrote: > > > I been working with DynAPI 3 for a couple of > weeks > > > now. Overall, I'm very > > > impressed and optimistic about the future of > DynAPI. > > > > > > I'm having trouble with (what I believe is) a > memory > > > leak in dynapi.js at > > > line 106: > > > > > > f.onunload = function() { > > > //alert('hi'); > > > for (var > > > i=0;i<o._unloadfn.length;i++) o._unloadfn[i](); > > > if (o.document) { > > > o.document._destroy(); > > > o.document = null; > > > } > > > }; > > > > > > I'm working on a window widget with quite a few > > > DynLayers and when unload > > > event triggers, the document unloads before the > > > above function is finished > > > and I get the following error in IE6: > > > > > > Error:'this.children[...]' is null or not an > > > object > > > > > > ...at which point I notice that my available > system > > > memory has been reduced > > > by a couple hundred KBytes or so. I get the same > > > error in Netscape 7.1, but > > > I can get around it by changing the event > listener > > > from 'onunload' to > > > 'onbeforeunload'. Alas, this does not fix the > > > problem in IE. Has anyone else > > > run into this problem? Are there any known > > > workarounds? Thanks in advance > > > for you help and keep up the good work. > > > > > > Jeremy Wanamaker > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email sponsored by: Free pre-built > > > ASP.NET sites including > > > Data Reports, E-commerce, Portals, and Forums > are > > > available now. > > > Download today and enter to win an XBOX or > Visual > > > Studio .NET. > > > > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > > _______________________________________________ > > > Dynapi-Dev mailing list > > > Dyn...@li... > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > __________________________________ > > Do you Yahoo!? > > Yahoo! SiteBuilder - Free, easy-to-use web site > design software > > http://sitebuilder.yahoo.com > > > > ATTACHMENT part 2 application/x-zip-compressed name=mem_leak.zip __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Jeremy W. <je...@ma...> - 2003-07-29 11:57:01
|
Thanks for your help Raymond. This did fix the error I was getting in IE, but there is still a memory leak. There is something funny about this widget. I was looking at it in the Mozilla DOM inspector and I noticed that there are multiple DynObjects with the same id. The ImgButton layer and it's children have the same id in both instances of ModWindow. I traced through the code, but couldn't figure out why this was happening. Maybe this has something to do with the error message. If anyone has a clue as to why this would happen, let me know. I'll keep looking at it. Jeremy ----- Original Message ----- From: "Raymond Irving" <xw...@ya...> To: <dyn...@li...> Cc: "Jeremy Wanamaker" <je...@ma...> Sent: Monday, July 28, 2003 11:53 AM Subject: Re: [Dynapi-Dev] memory leak > Hi Jeremy, > > This should fix the error. Make the change to the > dynlayer_base.js file. > > p._destroyAllChildren = function() { > for (var i=0;i<this.children.length;i++) { > this.children[i]._destroy(); > delete this.children[i]; > } > this.children.length=0; > }; > > It's very strange I don't see a memory leak with the > following examples: > > dynapi.api.dynlayer-destroy.html > speedtest.dynlayer-deep_nest.html > > It seems that the ModWindow object is not doing > something right. I don't understand why. > > Does anyone have any idea or solution? > > > -- > Raymond Irving > > > --- Jeremy Wanamaker <je...@ma...> wrote: > > I've attached a sample of my code which causes the > > error for me in IE 6. In > > my code, I have called 2 instances of my ModWindow > > widget. If I only call > > one instance, I don't get the error, but with two it > > shows up. I believe it > > may have to do with _destroy being called when the > > 'unload' event fires. > > Could it be that the _destroy function is unable to > > finish before the page > > is unloaded, thereby causing some object references > > to be lost? This would > > explain the memory leak. > > > > Jeremy Wanamaker > > > > ----- Original Message ----- > > From: "Raymond Irving" <xw...@ya...> > > To: <dyn...@li...> > > Cc: <je...@ma...> > > Sent: Friday, July 25, 2003 6:18 PM > > Subject: Re: [Dynapi-Dev] memory leak > > > > > > > > > > Could you please supply an example showing this > > error? > > > > > > I think this has something to do with the > > ._destroy() > > > function > > > > > > -- > > > Raymond Irving > > > > > > > > > --- Jeremy Wanamaker <je...@ma...> > > wrote: > > > > I been working with DynAPI 3 for a couple of > > weeks > > > > now. Overall, I'm very > > > > impressed and optimistic about the future of > > DynAPI. > > > > > > > > I'm having trouble with (what I believe is) a > > memory > > > > leak in dynapi.js at > > > > line 106: > > > > > > > > f.onunload = function() { > > > > //alert('hi'); > > > > for (var > > > > i=0;i<o._unloadfn.length;i++) o._unloadfn[i](); > > > > if (o.document) { > > > > o.document._destroy(); > > > > o.document = null; > > > > } > > > > }; > > > > > > > > I'm working on a window widget with quite a few > > > > DynLayers and when unload > > > > event triggers, the document unloads before the > > > > above function is finished > > > > and I get the following error in IE6: > > > > > > > > Error:'this.children[...]' is null or not an > > > > object > > > > > > > > ...at which point I notice that my available > > system > > > > memory has been reduced > > > > by a couple hundred KBytes or so. I get the same > > > > error in Netscape 7.1, but > > > > I can get around it by changing the event > > listener > > > > from 'onunload' to > > > > 'onbeforeunload'. Alas, this does not fix the > > > > problem in IE. Has anyone else > > > > run into this problem? Are there any known > > > > workarounds? Thanks in advance > > > > for you help and keep up the good work. > > > > > > > > Jeremy Wanamaker > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.Net email sponsored by: Free pre-built > > > > ASP.NET sites including > > > > Data Reports, E-commerce, Portals, and Forums > > are > > > > available now. > > > > Download today and enter to win an XBOX or > > Visual > > > > Studio .NET. > > > > > > > > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > > > _______________________________________________ > > > > Dynapi-Dev mailing list > > > > Dyn...@li... > > > > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! SiteBuilder - Free, easy-to-use web site > > design software > > > http://sitebuilder.yahoo.com > > > > > > > > ATTACHMENT part 2 application/x-zip-compressed > name=mem_leak.zip > > > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > |
From: Jeremy W. <je...@ma...> - 2003-07-29 16:07:20
|
I've solved the problem I posted earlier. I forgot to call the DynLayer prototype in my ImgButton prototype. The first two lines of the ImgButton function in my ModWindow widget should be: this.DynLayer=DynLayer; this.DynLayer(); This fixes the memory leak in Mozilla1.4/NS7.1, but IE 6 still leaks. It's less than before, but still there. I can live with it for now. Now if I could just fix that pesky permission denied error in Mozilla, I'd be happy. Jeremy ----- Original Message ----- From: "Raymond Irving" <xw...@ya...> To: <dyn...@li...> Cc: "Jeremy Wanamaker" <je...@ma...> Sent: Monday, July 28, 2003 11:53 AM Subject: Re: [Dynapi-Dev] memory leak > Hi Jeremy, > > This should fix the error. Make the change to the > dynlayer_base.js file. > > p._destroyAllChildren = function() { > for (var i=0;i<this.children.length;i++) { > this.children[i]._destroy(); > delete this.children[i]; > } > this.children.length=0; > }; > > It's very strange I don't see a memory leak with the > following examples: > > dynapi.api.dynlayer-destroy.html > speedtest.dynlayer-deep_nest.html > > It seems that the ModWindow object is not doing > something right. I don't understand why. > > Does anyone have any idea or solution? > > > -- > Raymond Irving > > > --- Jeremy Wanamaker <je...@ma...> wrote: > > I've attached a sample of my code which causes the > > error for me in IE 6. In > > my code, I have called 2 instances of my ModWindow > > widget. If I only call > > one instance, I don't get the error, but with two it > > shows up. I believe it > > may have to do with _destroy being called when the > > 'unload' event fires. > > Could it be that the _destroy function is unable to > > finish before the page > > is unloaded, thereby causing some object references > > to be lost? This would > > explain the memory leak. > > > > Jeremy Wanamaker > > > > ----- Original Message ----- > > From: "Raymond Irving" <xw...@ya...> > > To: <dyn...@li...> > > Cc: <je...@ma...> > > Sent: Friday, July 25, 2003 6:18 PM > > Subject: Re: [Dynapi-Dev] memory leak > > > > > > > > > > Could you please supply an example showing this > > error? > > > > > > I think this has something to do with the > > ._destroy() > > > function > > > > > > -- > > > Raymond Irving > > > > > > > > > --- Jeremy Wanamaker <je...@ma...> > > wrote: > > > > I been working with DynAPI 3 for a couple of > > weeks > > > > now. Overall, I'm very > > > > impressed and optimistic about the future of > > DynAPI. > > > > > > > > I'm having trouble with (what I believe is) a > > memory > > > > leak in dynapi.js at > > > > line 106: > > > > > > > > f.onunload = function() { > > > > //alert('hi'); > > > > for (var > > > > i=0;i<o._unloadfn.length;i++) o._unloadfn[i](); > > > > if (o.document) { > > > > o.document._destroy(); > > > > o.document = null; > > > > } > > > > }; > > > > > > > > I'm working on a window widget with quite a few > > > > DynLayers and when unload > > > > event triggers, the document unloads before the > > > > above function is finished > > > > and I get the following error in IE6: > > > > > > > > Error:'this.children[...]' is null or not an > > > > object > > > > > > > > ...at which point I notice that my available > > system > > > > memory has been reduced > > > > by a couple hundred KBytes or so. I get the same > > > > error in Netscape 7.1, but > > > > I can get around it by changing the event > > listener > > > > from 'onunload' to > > > > 'onbeforeunload'. Alas, this does not fix the > > > > problem in IE. Has anyone else > > > > run into this problem? Are there any known > > > > workarounds? Thanks in advance > > > > for you help and keep up the good work. > > > > > > > > Jeremy Wanamaker > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.Net email sponsored by: Free pre-built > > > > ASP.NET sites including > > > > Data Reports, E-commerce, Portals, and Forums > > are > > > > available now. > > > > Download today and enter to win an XBOX or > > Visual > > > > Studio .NET. > > > > > > > > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > > > _______________________________________________ > > > > Dynapi-Dev mailing list > > > > Dyn...@li... > > > > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! SiteBuilder - Free, easy-to-use web site > > design software > > > http://sitebuilder.yahoo.com > > > > > > > > ATTACHMENT part 2 application/x-zip-compressed > name=mem_leak.zip > > > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > |
From: Raymond I. <xw...@ya...> - 2003-07-29 17:45:44
|
Hi Jeremy, See below: --- Jeremy Wanamaker <je...@ma...> wrote: > I've solved the problem I posted earlier. I forgot > to call the DynLayer > prototype in my ImgButton prototype. The first two > lines of the ImgButton > function in my ModWindow widget should be: > > this.DynLayer=DynLayer; > this.DynLayer(); > > This fixes the memory leak in Mozilla1.4/NS7.1, but > IE 6 still leaks. It's > less than before, but still there. I can live with > it for now. Cool! >...Now if I > could just fix that pesky permission denied error in > Mozilla, I'd be happy. Well I believe this to be a Mozilla 1.4 bug. You can also try dropping mozilla a line about this Here's how you can reproduce the error: <script> function scan(e,elm) { var r = e.relatedTarget; while(r && r.parentNode){ r = r.parentNode; // error occurs here //alert(r) } } </script> <div id="dv" style="position:absolute;left:100;top:100"> <form name="frm"> <input type="textbox" name="tbox" value="test..." onmouseover="scan(event,this)" onmouseout="scan(event,this)"> </form> </div> The problem was traced back to mouse_dom.js line 49-51 MouseEvent._getContainerLayerOf = function(element) { if (!element) return null; while (!element._dynobj && element.parentNode && element.parentNode!=element) { element = element.parentNode; } return element._dynobj; }; Can anyone offer some help with this or post a message to mozilla? -- Raymond Irving > Jeremy > > ----- Original Message ----- > From: "Raymond Irving" <xw...@ya...> > To: <dyn...@li...> > Cc: "Jeremy Wanamaker" <je...@ma...> > Sent: Monday, July 28, 2003 11:53 AM > Subject: Re: [Dynapi-Dev] memory leak > > > > Hi Jeremy, > > > > This should fix the error. Make the change to the > > dynlayer_base.js file. > > > > p._destroyAllChildren = function() { > > for (var i=0;i<this.children.length;i++) { > > this.children[i]._destroy(); > > delete this.children[i]; > > } > > this.children.length=0; > > }; > > > > It's very strange I don't see a memory leak with > the > > following examples: > > > > dynapi.api.dynlayer-destroy.html > > speedtest.dynlayer-deep_nest.html > > > > It seems that the ModWindow object is not doing > > something right. I don't understand why. > > > > Does anyone have any idea or solution? > > > > > > -- > > Raymond Irving > > > > > > --- Jeremy Wanamaker <je...@ma...> > wrote: > > > I've attached a sample of my code which causes > the > > > error for me in IE 6. In > > > my code, I have called 2 instances of my > ModWindow > > > widget. If I only call > > > one instance, I don't get the error, but with > two it > > > shows up. I believe it > > > may have to do with _destroy being called when > the > > > 'unload' event fires. > > > Could it be that the _destroy function is unable > to > > > finish before the page > > > is unloaded, thereby causing some object > references > > > to be lost? This would > > > explain the memory leak. > > > > > > Jeremy Wanamaker > > > > > > ----- Original Message ----- > > > From: "Raymond Irving" <xw...@ya...> > > > To: <dyn...@li...> > > > Cc: <je...@ma...> > > > Sent: Friday, July 25, 2003 6:18 PM > > > Subject: Re: [Dynapi-Dev] memory leak > > > > > > > > > > > > > > Could you please supply an example showing > this > > > error? > > > > > > > > I think this has something to do with the > > > ._destroy() > > > > function > > > > > > > > -- > > > > Raymond Irving > > > > > > > > > > > > --- Jeremy Wanamaker <je...@ma...> > > > wrote: > > > > > I been working with DynAPI 3 for a couple of > > > weeks > > > > > now. Overall, I'm very > > > > > impressed and optimistic about the future of > > > DynAPI. > > > > > > > > > > I'm having trouble with (what I believe is) > a > > > memory > > > > > leak in dynapi.js at > > > > > line 106: > > > > > > > > > > f.onunload = function() { > > > > > //alert('hi'); > > > > > for (var > > > > > i=0;i<o._unloadfn.length;i++) > o._unloadfn[i](); > > > > > if (o.document) { > > > > > > o.document._destroy(); > > > > > o.document = null; > > > > > } > > > > > }; > > > > > > > > > > I'm working on a window widget with quite a > few > > > > > DynLayers and when unload > > > > > event triggers, the document unloads before > the > > > > > above function is finished > > > > > and I get the following error in IE6: > > > > > > > > > > Error:'this.children[...]' is null or > not an > > > > > object > > > > > > > > > > ...at which point I notice that my available > > > system > > > > > memory has been reduced > > > > > by a couple hundred KBytes or so. I get the > same > > > > > error in Netscape 7.1, but > > > > > I can get around it by changing the event > > > listener > > > > > from 'onunload' to > > > > > 'onbeforeunload'. Alas, this does not fix > the > > > > > problem in IE. Has anyone else > > > > > run into this problem? Are there any known > > > > > workarounds? Thanks in advance > > > > > for you help and keep up the good work. > > > > > > > > > > Jeremy Wanamaker > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > This SF.Net email sponsored by: Free > pre-built > > > > > ASP.NET sites including > > > > > Data Reports, E-commerce, Portals, and > Forums > > > are > > > > > available now. > > > > > Download today and enter to win an XBOX or > > > Visual > > > > > Studio .NET. > > > > > > > > > > > > > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > > > > > _______________________________________________ > > > > > Dynapi-Dev mailing list > > > > > Dyn...@li... > > > > > > > > > > > > > > > http://www.mail-archive.com/dyn...@li.../ > > > > > > > > > > > > __________________________________ > > > > Do you Yahoo!? > > > > Yahoo! SiteBuilder - Free, easy-to-use web > site > > > design software > > > > http://sitebuilder.yahoo.com > > > > > > > > > > > > ATTACHMENT part 2 application/x-zip-compressed > > name=mem_leak.zip > === message truncated === __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |