OOM Exceptions
Posted by biztodo on September 25, 2007
****************************************************************************
Event Type: Warning
Event Source: BizTalk Server 2006
Event Category: BizTalk Server 2006
Event ID: 5410
Description:
An error occurred that requires the BizTalk service to terminate. The most common causes are the following:
1) An unexpected out of memory error.
OR
2) An inability to connect or a loss of connectivity to one of the BizTalk databases.
The service will shutdown and auto-restart in 1 minute. If the problematic database remains unavailable, this cycle will repeat.
Error message: Exception of type ‘System.OutOfMemoryException’ was thrown.
Error source: mscorlib
****************************************************************************
If you are seeing these kind of out of memory exceptions more frequently on the event log of your BizTalk Server ; its probably a good time to reorganize the biztalk project. There are plenty of best practices and white papers published which offer good guidance. But most likely situation is that your architecture is already in place and you might be well into development or even production to do design level changes.
Here are some considerations that can be done without too much chaos.
Divide orchestrations,transforms,schemas and web references into separate assemblies. Usually the transforms are the culprits ; because if they are large(physical disk size) and if you are going to be working on large chunks of data at run time ; the memory required for that will be higher at run time.
Break away large transforms into smaller assemblies of their own if you think its getting too big at the same time being cautious of not getting too granular.
Be extremely wary about functoids that ship with BizTalk 2006. Some of the functoids are implemented as inline scripts resulting in the building of a System.Byte array in memory. Scripting with Inline C#, String,Math,DateTime are all inline scripts.Refer Microsoft support for more information on this. Extract from there..
The System.Policy.Security.Evidence object is often used in transforms and can consume a lot of memory. Whenever a map contains a scripting functoid that uses inline C# (or any other inline language), the assembly is created in memory. The System.Policy.Security.Evidence object uses the object of the actual calling assembly. This situation creates a rooted object that is not deleted until the BizTalk service is restarted. We recommend that you call an external assembly instead.
Best practice – when using many inline scripted functoids try to separate out the assembly to smaller sizes