You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Cliff Zhao <zh...@gmail.com> on 2006/06/23 21:14:59 UTC

Tapestry leaks memory in IE and my workaround

Tapestry leaks memory in IE. I'm using Tap 4.0.2. I did some research and
like to share it with you. The leaks may be more than I listed here as I did
not use client side validation on forms.

Tapestry form and DatePicker leak memory IE, here is what I did to remove
the leaks.

// the following code is to hack IE memory leaks.
if (typeof Calendar=="function") {
    var tap_calendar_create=Calendar.prototype.create;
    Calendar.prototype.create=function() {
        tap_calendar_create.call(this);
        dojo.event.browser.addClobberNodeAttrs
(this._previousMonth,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs(this._nextMonth,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._todayButton,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._clearButton,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._calDiv,["onselectstart","onkeydown","onmousewheel"]);
        dojo.event.browser.addClobberNodeAttrs(this._table,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._monthSelect,["onchange","onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._yearSelect,["onchange"]);
        return this._calDiv;
    };
}

if (typeof Tapestry=="object") {
    Tapestry.register_form = function(formId)
    {
      var form = this.find(formId);

      form.events = new FormEventManager(form);
      dojo.event.browser.addClobberNodeAttrs
(form,["events","onsubmit","onreset"]);
    };
}


Best Regards,
Cliff Zhao

Re: Tapestry leaks memory in IE and my workaround

Posted by Jesse Kuhnert <jk...@gmail.com>.
It's not really relevant enough to warrent a JIRA issue. This leak would
only happen on pages where you are doing XHR type requests...Tap4.1 doesn't
use this method of adding events anymore. (I have provided a backwards
compatible set of JS functions to mimick the function calls, but they all
use dojo to do the actual event connections now.)

In fact, there probably won't be any JS in the system that isn't replaced in
the next release. Esp anything having to do with forms / validation.

On 6/25/06, hv @ Fashion Content <in...@fashioncontent.com> wrote:
>
> Have you posted a JIRA bug report?
>
> "Cliff Zhao" <zh...@gmail.com> skrev i en meddelelse
> news:ef28a20a0606231214o7697ae4ap91a9abc08a2475c2@mail.gmail.com...
> > Tapestry leaks memory in IE. I'm using Tap 4.0.2. I did some research
> and
> > like to share it with you. The leaks may be more than I listed here as I
> > did
> > not use client side validation on forms.
> >
> > Tapestry form and DatePicker leak memory IE, here is what I did to
> remove
> > the leaks.
> >
> > // the following code is to hack IE memory leaks.
> > if (typeof Calendar=="function") {
> >    var tap_calendar_create=Calendar.prototype.create;
> >    Calendar.prototype.create=function() {
> >        tap_calendar_create.call(this);
> >        dojo.event.browser.addClobberNodeAttrs
> > (this._previousMonth,["onclick"]);
> >
> > dojo.event.browser.addClobberNodeAttrs(this._nextMonth,["onclick"]);
> >        dojo.event.browser.addClobberNodeAttrs
> > (this._todayButton,["onclick"]);
> >        dojo.event.browser.addClobberNodeAttrs
> > (this._clearButton,["onclick"]);
> >        dojo.event.browser.addClobberNodeAttrs
> > (this._calDiv,["onselectstart","onkeydown","onmousewheel"]);
> >        dojo.event.browser.addClobberNodeAttrs(this._table,["onclick"]);
> >        dojo.event.browser.addClobberNodeAttrs
> > (this._monthSelect,["onchange","onclick"]);
> >        dojo.event.browser.addClobberNodeAttrs
> > (this._yearSelect,["onchange"]);
> >        return this._calDiv;
> >    };
> > }
> >
> > if (typeof Tapestry=="object") {
> >    Tapestry.register_form = function(formId)
> >    {
> >      var form = this.find(formId);
> >
> >      form.events = new FormEventManager(form);
> >      dojo.event.browser.addClobberNodeAttrs
> > (form,["events","onsubmit","onreset"]);
> >    };
> > }
> >
> >
> > Best Regards,
> > Cliff Zhao
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

Re: Tapestry leaks memory in IE and my workaround

Posted by "hv @ Fashion Content" <in...@fashioncontent.com>.
Have you posted a JIRA bug report?

"Cliff Zhao" <zh...@gmail.com> skrev i en meddelelse 
news:ef28a20a0606231214o7697ae4ap91a9abc08a2475c2@mail.gmail.com...
> Tapestry leaks memory in IE. I'm using Tap 4.0.2. I did some research and
> like to share it with you. The leaks may be more than I listed here as I 
> did
> not use client side validation on forms.
>
> Tapestry form and DatePicker leak memory IE, here is what I did to remove
> the leaks.
>
> // the following code is to hack IE memory leaks.
> if (typeof Calendar=="function") {
>    var tap_calendar_create=Calendar.prototype.create;
>    Calendar.prototype.create=function() {
>        tap_calendar_create.call(this);
>        dojo.event.browser.addClobberNodeAttrs
> (this._previousMonth,["onclick"]);
> 
> dojo.event.browser.addClobberNodeAttrs(this._nextMonth,["onclick"]);
>        dojo.event.browser.addClobberNodeAttrs
> (this._todayButton,["onclick"]);
>        dojo.event.browser.addClobberNodeAttrs
> (this._clearButton,["onclick"]);
>        dojo.event.browser.addClobberNodeAttrs
> (this._calDiv,["onselectstart","onkeydown","onmousewheel"]);
>        dojo.event.browser.addClobberNodeAttrs(this._table,["onclick"]);
>        dojo.event.browser.addClobberNodeAttrs
> (this._monthSelect,["onchange","onclick"]);
>        dojo.event.browser.addClobberNodeAttrs
> (this._yearSelect,["onchange"]);
>        return this._calDiv;
>    };
> }
>
> if (typeof Tapestry=="object") {
>    Tapestry.register_form = function(formId)
>    {
>      var form = this.find(formId);
>
>      form.events = new FormEventManager(form);
>      dojo.event.browser.addClobberNodeAttrs
> (form,["events","onsubmit","onreset"]);
>    };
> }
>
>
> Best Regards,
> Cliff Zhao
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org