This post disappeared from a previous blog of mine so I'm reposting it.

One may get the impression, based on the example configuration listing for 'AppDomain configuration' in the BTS docs (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/ebiz_prog_orch_jzex.asp), that the Orchestration Engine's default values for SecondsIdleBeforeShutdown and SecondsEmptyBeforeShutdown are 1200 and 1800, respectively.   The example configurations are so plagued with errors that I investigated a bit further.

In the Microsoft.XLANGs.BizTalk.CrossProcess.AppDomains constructor (in the Microsoft.XLANGs.BizTalk.CrossProcess assembly),
the default values are set to the reverse:

SecondsIdleBeforeShutdown = 1800 (30 minutes)
SecondsEmptyBeforeShutdown =  1200 (20 minutes)

Obviously these values could be reset to something other than their default values by code that executed after the constructor but it does appear that the default values are reversed in relation to the example's configuration.

In case you are not familiar with the settings here is a snip from the referenced page in the BizTalk docs:

"In this section the user may specify default configuration for any app domain created that does not have a named configuration associated with it (see AppDomainSpecs below) SecondsEmptyBeforeShutdown is the number of seconds that an app domain is empty (that is, it does not contain any orchestrations) before being unloaded. Specify -1 to signal that an app domain should never unload, even when empty. Similarly, SecondsIdleBeforeShutdown is the number of seconds that an app domain is idle (that is, it contains only dehydratable orchestrations) before being unloaded. Specify -1 to signal that an app domain should never unload when idle but not empty. When an idle but non-empty domain is shut down, all of the contained instances are dehydrated first."

I encourage you to review all of the Orchestration Engine settings on the referenced page; many of them are very useful.