Hi,
As far as I know IE won't fire more than two simultanous http request.
So i'm not quite sure about it.

   OK, I don't know how real this problem would be anyway. However,
   something still leaks slowly: I left a wicket page using 
AjaxSelfUpdatingTimer
(which fires once per second) running over easter. When I came back to office today, the page was still updating itself but internet explorer
   was a log bigger (like 10x).

   But things are a *lot* better now - before a test like this would have
   crashed the browser.

       Ari S.


-Matej

Ari Suutari wrote:
I found one potential (minor) problem: if timer creates ajax requests
so frequently that web server lags behind the the system leaks
again because it needs to always allocate new transport object
since all existing ones are busy ? Maybe there should be some
kind of upper limit for transport pool.

Maybe this isn't any more such a big problem for most folks.
It occurs me when updating a label with 100 ms timer (well, actually,
maybe the timer in AjaxSelfUpdatingTimerBehavour shouldn't fire
until previous request has completed ?)

   Ari S.

----- Original Message ----- From: "Matej Knopp" <[EMAIL PROTECTED]>
To: <wicket-user@lists.sourceforge.net>
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
     >      >      >>> Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>
     >      >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>>
     >      >      >>>
    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
     >      >      >> Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>
     >      >     <mailto: Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>>
     >      >      >>
    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
     >      >      > Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>
     >      >     <mailto: Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>>
     >      >      >
    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
     >      >     Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto: Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>
     >      >     <mailto: Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto: Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>>
> > 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
     >     Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
     >     <mailto:Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>>
     >     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
    Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
    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
Wicket-user@lists.sourceforge.net
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
Wicket-user@lists.sourceforge.net
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
Wicket-user@lists.sourceforge.net
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
Wicket-user@lists.sourceforge.net
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to