How to handle script timeouts when closing windows in IE?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to handle script timeouts when closing windows in IE?

Cajus Pollmeier
Hi all,

I ran into problems with qooxdoo 1.3 recently, where it seems to take to long
for IE to run destructors and whatever needed to shut down an application
after the users just closes the application window.

Almost everytime, I get the message that (freely translated from german):

"A script on this page is causing IE to run slowly. If it continues to run,
your computer may be unresponsive."

Just looks like a timeout in IE which can be configured, but are there general
hints on "how to shutdown an application fast enough"?

Cheers,
Cajus

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Antw: How to handle script timeouts when closing windows in IE?

robert.nimax
Hi,
we had the same issue. This happens if there was a complex GUI having many widgets because IE is...ah, you know about this. :-)
We solved this problem with partial disposing. So you´ve got to reorganize your destruction logic and perform a clean-up stepwise. After each step you have to give the control back to the browser like this:
 
setTimeout(
  (function() {
    var doContinue  = true;
    // do one of the destructions / clean-up steps
   ...
   if (doContinue) {
    setTimeout(arguments.calle, 10);
   }         
}), 10);
 
HTH,
Rob.

>>> Cajus Pollmeier <[hidden email]> 2/3/2011 3:00 >>>
Hi all,

I ran into problems with qooxdoo 1.3 recently, where it seems to take to long
for IE to run destructors and whatever needed to shut down an application
after the users just closes the application window.

Almost everytime, I get the message that (freely translated from german):

"A script on this page is causing IE to run slowly. If it continues to run,
your computer may be unresponsive."

Just looks like a timeout in IE which can be configured, but are there general
hints on "how to shutdown an application fast enough"?

Cheers,
Cajus

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Antw: How to handle script timeouts when closing windows in IE?

robert.nimax
Hi,
there is one more thing to think about: Maybe you got big memory leaks ?
The object registry will be shut down (at the moment you leave your qooxdoo application) and tries to free all of the objects that are still in the object registry.
Please check this first.
 
HTH,
Rob.

>>> "Robert Nimax" <[hidden email]> 2/3/2011 3:15 >>>
Hi,
we had the same issue. This happens if there was a complex GUI having many widgets because IE is...ah, you know about this. :-)
We solved this problem with partial disposing. So you´ve got to reorganize your destruction logic and perform a clean-up stepwise. After each step you have to give the control back to the browser like this:
 
setTimeout(
  (function() {
    var doContinue  = true;
    // do one of the destructions / clean-up steps
   ...
   if (doContinue) {
    setTimeout(arguments.calle, 10);
   }         
}), 10);
 
HTH,
Rob.

>>> Cajus Pollmeier <[hidden email]> 2/3/2011 3:00 >>>
Hi all,

I ran into problems with qooxdoo 1.3 recently, where it seems to take to long
for IE to run destructors and whatever needed to shut down an application
after the users just closes the application window.

Almost everytime, I get the message that (freely translated from german):

"A script on this page is causing IE to run slowly. If it continues to run,
your computer may be unresponsive."

Just looks like a timeout in IE which can be configured, but are there general
hints on "how to shutdown an application fast enough"?

Cheers,
Cajus

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Antw: How to handle script timeouts when closing windows in IE?

Cajus Pollmeier
Hi Rob,

thanks for the hints. Investigating now ;-)

Cheers,
Cajus

Am Donnerstag 03 Februar 2011, 15:24:48 schrieb Robert Nimax:

> Hi,
> there is one more thing to think about: Maybe you got big memory leaks
> ?
> The object registry will be shut down (at the moment you leave your
> qooxdoo application) and tries to free all of the objects that are still
> in the object registry.
> Please check this first.
>
> HTH,
> Rob.
>
> >>> "Robert Nimax" <[hidden email]> 2/3/2011 3:15 >>>
>
> Hi,
> we had the same issue. This happens if there was a complex GUI having
> many widgets because IE is...ah, you know about this. :-)
> We solved this problem with partial disposing. So you´ve got to
> reorganize your destruction logic and perform a clean-up stepwise. After
> each step you have to give the control back to the browser like this:
>
> setTimeout(
>   (function() {
>     var doContinue  = true;
>     // do one of the destructions / clean-up steps
>    ...
>    if (doContinue) {
>     setTimeout(arguments.calle, 10);
>    }
> }), 10);
>
> HTH,
> Rob.
>
> >>> Cajus Pollmeier <[hidden email]> 2/3/2011 3:00 >>>
>
> Hi all,
>
> I ran into problems with qooxdoo 1.3 recently, where it seems to take
> to long
> for IE to run destructors and whatever needed to shut down an
> application
> after the users just closes the application window.
>
> Almost everytime, I get the message that (freely translated from
> german):
>
> "A script on this page is causing IE to run slowly. If it continues to
> run,
> your computer may be unresponsive."
>
> Just looks like a timeout in IE which can be configured, but are there
> general
> hints on "how to shutdown an application fast enough"?
>
> Cheers,
> Cajus
>
> ---------------------------------------------------------------------------
> --- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better
> price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Antw: How to handle script timeouts when closing windows in IE?

Dave Baggett
In reply to this post by robert.nimax
robert.nimax wrote
Hi, we had the same issue. This happens if there was a complex GUI having
many widgets because IE is...ah, you know about this. :-)
We solved this problem with partial disposing. So you´ve got to
reorganize your destruction logic and perform a clean-up stepwise. After
each step you have to give the control back to the browser like this:
[...]
I have the same problem. IMHO, QooxDoo should divide the destruction process up into multiple events itself to avoid this problem.

One strategy I use in our app (in many places) is to run a recurring event using setTimeout that does some work, then checks to see how much time it's used. If it has used more than 100ms, I setTimeout again to return in 100ms and immediately exit the event. This means we only run 100ms of computation in any given event, and -- assuming it takes more than 100ms to run 5M instructions -- we won't get the IE "script too slow" warning. (It's not always trivial to divide work up into little pieces like this, though, because you never want to leave data structures in an intermediate state.)

According to Eric Lawrence at Microsoft, IE's 5M instruction limit is set in the registry, and the only way to reset the counter is to begin a new event. An incredibly annoying aspect of this warning is that there is no way to tell what was running when the dialog popped up -- even when you're running in the debugger. So the only thing you can do is run your code in the profiler, cause the popup (if it's easily repeatable), and see what used lots of cycles.

Dave