Microsoft KB Archive/913959

= The BizTalk service restarts unexpectedly when you map large messages in BizTalk Server 2004 =

Article ID: 913959

Article Last Modified on 5/11/2007

-

APPLIES TO


 * Microsoft BizTalk Server 2004 Standard Edition
 * Microsoft BizTalk Server 2004 Enterprise Edition
 * Microsoft BizTalk Server 2004 Developer Edition
 * Microsoft BizTalk Server 2004 Partner Edition

-





SYMPTOMS
When you map large messages in Microsoft BizTalk Server 2004, the BizTalk service may restart unexpectedly. You may receive an error message in the Application log in Event Viewer that is similar to the following:

Event Type: Warning

Event Source: BizTalk Server 2004

Event Category: BizTalk Server 2004

Event ID: 5410

Description:

An error has occurred that requires the BizTalk service to terminate. The most common causes are an unexpected out of memory error and 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.



CAUSE
This issue may occur if one of the following conditions is true:
 * Available memory is fragmented and contiguous memory is unavailable.
 * The transformation process has consumed all available memory.



WORKAROUND
To work around this issue, use one of the following methods:
 * Split large files into smaller files before you process the files in BizTalk Server 2004.
 * Use a custom application to map the large files outside BizTalk Server 2004. Then call the custom application from BizTalk Server 2004.



MORE INFORMATION
To map data, the Mapper in BizTalk Server 2004 passes a stream object that is loaded into an XPathDocument object. The XPathDocument object is processed by the XSLTransform class. To provide faster access to the data as the transformation process runs, the XPathDocument object stores information about the nodes of the XML together with the data itself. This behavior requires contiguous memory. Therefore, you experience a System.OutofMemoryException error when contiguous memory is unavailable or when the transformation process has consumed all available memory.

There is no specific file size threshold where the System.OutofMemoryException error occurs. We recommend that you fully test the following kinds of solutions before you deploy these solutions in a production environment:
 * Solutions that contain XML files of 1 megabyte (MB) or more
 * Solutions that require the processing of smaller flat files if these files will become larger when they are converted to XML in BizTalk Server 2004
 * Solutions that have all the kinds of messages that you expect in the production environment

Memory fragmentation may occur when smaller messages are processed in BizTalk Server 2004. This memory fragmentation may cause the issue that is mentioned in the &quot;Symptoms&quot; section when a larger message is processed.

The following scenarios may also cause System.OutofMemoryException errors:
 * Processing large messages by using the Business Rules Engine.
 * Processing large messages by using the Microsoft BizTalk Adapter for SQL Server.
 * Processing XML messages that contain very large CDATA sections. This issue can occur even when you stream data because CDATA sections cannot be split.

