Revision history [back]

click to hide/show revision 1
initial version

answered 2017-03-31 01:55:43 +0800

cor3000 gravatar image cor3000

ZK Team

yes there is a configuration that affects this (and the usual browser related security features)

  1. if using Desktop Recycling then destroy won't be called, as the desktop instance is cached for later reuse.

  2. sometimes the desktop cleanup mechanism is interrupted by browsers (could be the case if an older ZK version is used). In general it works like that (just to give you a few points where to start debugging).

Once the browser closes a tab/reloads a page/navigates to another URL it triggers an onBeforeUnload event. ZK listens to this in order to send a final request to the server to remove the desktop (rmDesktop) which looks like this:

http://server:[port]/appname/zkau?dtid=zab23&cmd0=rmDesktop&opt_0=i

You can verify those events in your browser's network tab (F12 in Chrome and don't forget to enable 'Preserve log') or using other network monitoring tools such as fiddler2 or wireshark.

Without this event (e.g. the browser crashed, or security settings/constraints prevent AJAX calls in onBeforeUnload) ZK doesn't know the client is gone, and keeps the Desktop in the cache until the Session times out, or the max number of desktops per session is reached, or the desktop timeout was exceeded (however a desktop timeout doesn't clean the desktop immediately it merely makes it eligible for GC)

yes there is a configuration that affects this (and the usual browser related security features)

  1. if using Desktop Recycling then destroy won't be called, as the desktop instance is cached for later reuse.

  2. sometimes the desktop cleanup mechanism is interrupted by browsers (could be the case if an older ZK version is used).

In general it works like that (just to give you a few points where to start debugging).

debugging): Once the browser closes a tab/reloads a page/navigates to another URL it triggers an onBeforeUnload event. ZK listens to this in order to send a final request to the server to remove the desktop (rmDesktop) which looks like this:

http://server:[port]/appname/zkau?dtid=zab23&cmd0=rmDesktop&opt_0=i

You can verify those events in your browser's network tab (F12 in Chrome and don't forget to enable 'Preserve log') or using other network monitoring tools such as fiddler2 or wireshark.

Without this event (e.g. the browser crashed, or security settings/constraints prevent AJAX calls in onBeforeUnload) ZK doesn't know the client is gone, and keeps the Desktop in the cache until the Session times out, or the max number of desktops per session is reached, or the desktop timeout was exceeded (however a desktop timeout doesn't clean the desktop immediately it merely makes it eligible for GC)

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More