Hi Jhonny,

jhonny thio wrote:
> hii...
> I have an application that using a timer (every 1 second). The timer will 
> always request data to the AJAX (php)..
Just a curious question: is this really necessary for your application 
or can you rely on events rather than polling the server every second?

> Here is the code : 
> 
> timer = new qx.client.Timer(1000); 
> timer.addEventListener("interval", this._timerku, this);        
> timer.start(); 
> 
> _timerku : function()
>  {
>         var reqall = new qx.io.remote.Request("JtChat/thread.php", "GET", 
> "text/plain");
>         reqall.send();
>         reqall.addEventListener("completed", function(e){
>             .....
>             .....
>             .....
>         }, this);
>  }
> 
> It mean every second the program will make a new object (==> reqall). Does it 
> consume a lot memory?
Every request object is disposed after the request is completed, so in 
theory there should be no increasing memory consumption. However the 
garbage collection mechanism of the browsers do not release memory of 
disposed objects right away. So it may lead to a increasing memory 
consumption temporarily (before the cycle of the gargabe collector starts).

> Maybe someone has a good step how to request AJAX every 1s ?
Rely on events rather than polling the server could be a solution if 
this is a scenario for your application.

cheers,
   Alex

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to