I can confirm that it works for me too.
Hopefully this fix will get into next beta/rc of 1.2 !

   Ari S.

----- Original Message ----- From: "Matej Knopp" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, April 12, 2006 9:51 PM
Subject: Re: [Wicket-user] wicket ajax memory leak with IE


Hi, I made some changes, this really helps, at least it works for me:

// AJAX FUNCTIONS
function wicketAjaxCreateTransport() {
    var transport = null;
    if (window.XMLHttpRequest) {
        transport = new XMLHttpRequest();
    } else {
        if (window.ActiveXObject) {
            transport = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }

    if (transport==null&&wicketAjaxDebugEnabled()) {
        var log=WicketAjaxDebug.logError;
log("Could not locate ajax transport. Your browser does not support the required XMLHttpRequest object or wicket could not gain access to it.");
    }
    return transport;
}

var wicketAjaxTransports = [];


function wicketAjaxGetTransport() {
var t = wicketAjaxTransports;
for (var i = 0; i < t.length; ++i) {
if (t[i].readyState == 0 || t[i].readyState == 4) {
return t[i];
}
}
t[t.length] = wicketAjaxCreateTransport();
return t[t.length-1];
}

function wicketAjaxGet(url, successHandler, failureHandler) {
    if (wicketAjaxDebugEnabled()) {
        var log=WicketAjaxDebug.logInfo;
        log("");
        log("initiating ajax GET request with...");
        log("url: "+url);
        log("successHandler:"+successHandler);
        log("failureHandler:"+failureHandler);
    }

    var transport = wicketAjaxGetTransport();
    if (transport == null) {
        return false;
    }
    transport.open("GET", url + "&random=" + Math.random(), true);
    transport.onreadystatechange = function () {
        wicketAjaxOnStateChange(transport, successHandler, failureHandler);
        if (transport.readyState == 4) {
        transport.onreadystatechange = function () {};
        transport = null;
        }
    };
    transport.send(null);

    return true;
}
function wicketAjaxPost(url, body, successHandler, failureHandler) {
    if (wicketAjaxDebugEnabled()) {
        var log=WicketAjaxDebug.logInfo;
        log("");
        log("initiating ajax POST request with...");
        log("url: "+url);
        log("body: "+body);
        log("successHandler:"+successHandler);
        log("failureHandler:"+failureHandler);
    }

    var transport = wicketAjaxGetTransport();
    if (transport == null) {
        return false;
    }
    transport.open("POST", url + "&random=" + Math.random(), true);
    transport.onreadystatechange = function () {
        wicketAjaxOnStateChange(transport, successHandler, failureHandler);
        if (transport.readyState == 4) {
        transport.onreadystatechange = function () {};
        transport = null;
        }
    };
transport.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    transport.send(body);

    return true;
}

Matej Knopp wrote:
I guess I have seen one. But it shouldn't be that difficult to get it done. I guess I might be able to look into it tonight.

-Matej

Igor Vaynberg wrote:
is there a pooling implementation somewhere i can take a look at and borrow, im not really inerested in becoming a javascript wiz just because ms cant get it right.

-Igor


On 4/12/06, *Matej Knopp* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    AFAIK There's nothing wrong with javascript. The problem is that
    creating XMLHttpRequest every time causes memory leak in IE.

People tend to reuse one instance of xmlhttprequest, but that does not suffice here, i guess, therefore I suggested xmlhttprequests instances
    pooling.

    I tried to reuse one instance of xmlhttprequest and the leak was no
    longer there. At least with the test application. (The one in this
    thread).

The only thing when you are "reusing" XmlHttpRequests is that you must
    call transport.open before you assign transport.onreadystate = ...
    (some weird IE related thing)

    -Matej

    Igor Vaynberg wrote:
     > i looked through the javascript but nothing jumped out at me. did
    you
     > notice anything cause im stumped.
     >
     > -Igor
     >
     > On 4/12/06, *Matej Knopp* < [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]> >> wrote:
     >
> Yeah, it is. However, it's much smaller. But still, 10-15 kb per
     >     request.
     >
     >     -Matej
     >
     >     Igor Vaynberg wrote:
     >      > is the leak still there if you turn off the ajax debug
    mode in
     >      > IAjaxSettings?
     >      >
     >      > -Igor
     >      >
     >      >
     >      > On 4/12/06, *Matej Knopp* < [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
     >     <mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
    <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
     >     <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>> wrote:
     >      >
     >      >     Ari Suutari wrote:
     >      >      >> need several requests at the same time. So maybe
    pooling of
     >      >      >> XmlHttpRequest(s) could work...
     >      >      >
> > > Btw, does dojo use pooling (since there was no leak
     >     with it) ?
     >      >      >    Maybe it would make sense to check how they are
    getting
     >     around
     >      >      >    this.
     >      >      >
     >      >      >        Ari S.
     >      >      >
> > Don't know, might be worth checking. But dojo codebase is
     >     quite big and
     >      >     the code little hard to read, mostly because dojo
    handles a
     >     lot of other
     >      >     things (back button support, etc.)
     >      >
     >      >     -Matej
     >      >      >>
     >      >      >> -Matej
     >      >      >>
     >      >      >> Ari Suutari wrote:
     >      >      >>> Hi,
     >      >      >>>
     >      >      >>> There is a browser-side memory leak in wicket
    ajax stuff
     >     when used
     >      >      >>> with internet explorer. We discovered it when
    changing our
     >      >     application
     >      >      >>> from wichet+dojo to wicket+wicket-ajax.
     >      >      >>>
> > >>> Memory leak occurs only if wicket-ajax is used in IE.
     >     With dojo,
     >      >      >>> there is on leak. Also, in firefox, neither
    solution leaks.
     >      >      >>>
     >      >      >>> There is a simple example available at
     >      >      >>>
     >      >      >>>
     >     http://download.syncrontech.com/public/wicketajaxleak.zip
     >     <http://download.syncrontech.com/public/wicketajaxleak.zip>
     >      >     <
    http://download.syncrontech.com/public/wicketajaxleak.zip>
     >      >      >>>
     >      >      >>> It just displays a number, increments it and
    displays it
     >     again
     >      >      >>> using ajax.
     >      >      >>>
     >      >      >>> There is also a memory usage graph which has data
    from
     >      >      >>> dojo and wicket-default ajax cases, from that it
    is easy
> > >>> to see how differenty these implementations behave.
     >      >      >>>
> > >>> http://download.syncrontech.com/public/wicketajax.gif
     >     <http://download.syncrontech.com/public/wicketajax.gif>
     >      >      >>>
     >      >      >>> These runs were done agains wicket 1.2-beta3.
     >      >      >>> This is a rather nasty problem for us, since we
    have a lot
     >      >      >>> of pages, which update themselves very frequently
    based on
     >      >      >>> data coming from automation systems.
     >      >      >>>
     >      >      >>> We did some looking around in wicket-ajax.js but
    didn't
     >      >      >>> find anything obvious.
     >      >      >>>
     >      >      >>>    Ari S.
     >      >      >>>
     >      >      >>>
     >      >      >>>
     >      >      >>>
    -------------------------------------------------------
     >      >      >>> This SF.Net email is sponsored by xPML, a
    groundbreaking
     >     scripting
     >      >      >>> language
> > >>> that extends applications into web and mobile media.
     >     Attend the
     >      >     live
     >      >      >>> webcast
> > >>> and join the prime developer group breaking into this
     >     new coding
     >      >      >>> territory!
     >      >      >>>
     >      >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>
     >      >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
     >     <
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>>
     >      >      >>> _______________________________________________
     >      >      >>> Wicket-user mailing list
     >      >      >>> [email protected]
    <mailto:[email protected]>
     >     <mailto:[email protected]
    <mailto:[email protected]>>
     >      >     <mailto:[email protected]
    <mailto:[email protected]>
     >     <mailto:[email protected]
    <mailto:[email protected]>>>
     >      >      >>>
    https://lists.sourceforge.net/lists/listinfo/wicket-user
     >     < https://lists.sourceforge.net/lists/listinfo/wicket-user>
     >      >      >>>
     >      >      >>
     >      >      >>
     >      >      >>
     >      >      >>
    -------------------------------------------------------
     >      >      >> This SF.Net email is sponsored by xPML, a
    groundbreaking
     >     scripting
     >      >      >> language
> > >> that extends applications into web and mobile media.
     >     Attend the live
     >      >      >> webcast
     >      >      >> and join the prime developer group breaking into
    this new
     >     coding
     >      >      >> territory!
     >      >      >>
     >      >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>
     >      >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
     >     <
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>>
     >      >      >> _______________________________________________
     >      >      >> Wicket-user mailing list
     >      >      >> [email protected]
    <mailto:[email protected]>
     >     <mailto:[email protected]
    <mailto:[email protected]>>
     >      >     <mailto: [email protected]
    <mailto:[email protected]>
     >     <mailto:[email protected]
    <mailto:[email protected]>>>
     >      >      >>
    https://lists.sourceforge.net/lists/listinfo/wicket-user
     >      >     <
    https://lists.sourceforge.net/lists/listinfo/wicket-user>
     >      >      >>
     >      >      >
     >      >      >
     >      >      >
    -------------------------------------------------------
     >      >      > This SF.Net email is sponsored by xPML, a
    groundbreaking
     >      >     scripting language
     >      >      > that extends applications into web and mobile media.
     >     Attend the live
     >      >      > webcast
     >      >      > and join the prime developer group breaking into
    this new
     >     coding
     >      >     territory!
     >      >      >
     >      >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
     >     <
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>
     >      >
     >     <
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>>
     >      >      > _______________________________________________
     >      >      > Wicket-user mailing list
     >      >      > [email protected]
    <mailto:[email protected]>
     >     <mailto:[email protected]
    <mailto:[email protected]>>
     >      >     <mailto: [email protected]
    <mailto:[email protected]>
     >     <mailto:[email protected]
    <mailto:[email protected]>>>
     >      >      >
    https://lists.sourceforge.net/lists/listinfo/wicket-user
     >      >      >
     >      >
     >      >
     >      >
     >      >     -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking
     >     scripting
     >      >     language
     >      >     that extends applications into web and mobile media.
    Attend
     >     the live
     >      >     webcast
     >      >     and join the prime developer group breaking into this
    new coding
     >      >     territory!
     >      >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>
     >      >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>>
     >      >     _______________________________________________
     >      >     Wicket-user mailing list
     >      >     [email protected]
    <mailto:[email protected]>
     >     <mailto: [email protected]
    <mailto:[email protected]>>
     >      >     <mailto: [email protected]
    <mailto:[email protected]>
     >     <mailto: [email protected]
    <mailto:[email protected]>>>
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
     >     < https://lists.sourceforge.net/lists/listinfo/wicket-user>
     >      >
     >      >
     >
     >
     >
     >     -------------------------------------------------------
     >     This SF.Net email is sponsored by xPML, a groundbreaking
    scripting
     >     language
     >     that extends applications into web and mobile media. Attend
    the live
     >     webcast
> and join the prime developer group breaking into this new coding
     >     territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
     >     <
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>>
     >     _______________________________________________
     >     Wicket-user mailing list
     >     [email protected]
    <mailto:[email protected]>
     >     <mailto:[email protected]
    <mailto:[email protected]>>
     >     https://lists.sourceforge.net/lists/listinfo/wicket-user
     >
     >



    -------------------------------------------------------
    This SF.Net email is sponsored by xPML, a groundbreaking scripting
    language
    that extends applications into web and mobile media. Attend the live
    webcast
    and join the prime developer group breaking into this new coding
    territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
    _______________________________________________
    Wicket-user mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/wicket-user





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to