Software AG Products 10.11 | Administering Integration Server | Configuring the Enhanced XML Parser | How Does the Enhanced XML Parser Work?
 
How Does the Enhanced XML Parser Work?
The enhanced XML parser parses a document by serializing it into partitions that reside on the JVM heap. As the number of partitions and the amount of heap space required to parse the document increases, the parser uses Terracotta Ehcache to move partitions to a local disk store or off-heap cache (BigMemory). Integration Server retrieves the partitions as needed to fulfill subsequent processing requests.
The enhanced xml parser uses heap allocation limits to determine when to migrate partitions to a local disk store or BigMemory. The heap allocation limits enable the enhanced XML parser to throttle its use of heap. This reduces the chances of unstable behavior when the Integration Server operates at peak capacity. You can set limits for:
*The total heap space used by any single parsed document.
*The total heap space used by all parsed documents combined.
*The total amount of BigMemory used by all parsed documents
Following is an overview of how the enhanced XML parser parses an XML document:
1. The enhanced XML parser receives a request to parse a document. To begin parsing a document, the enhanced XML parser creates six partitions of the same size in the heap. The size of the partitions is determined by the partitionSize value passed to the service or the default partition size configured for the enhanced XML parser. For more information about the partition size, see Setting the Partition Size.
However, if there is not sufficient heap space to create six partitions, the enhanced XML parser delays parsing the document until sufficient heap space becomes available. There might not be sufficient heap space if the amount of heap space currently used for parsed documents is at or near the limit specified by the Maximum heap allocation for all documents combined field.
2. The enhanced XML parser serializes the XML document into the partitions on the heap, creating more partitions of the same size as needed.
3. During parsing, if the total heap space required to parse the document meets the limit specified by the Maximum heap allocation for any single document field or the limit specified by Maximum heap allocation for all documents combined, one of the following occurs:
*If caching is not enabled, meaning that the parser does not use Terracotta Ehcache to help manage memory, the JVM may throw an OutOfMemoryError. The enhanced XML parser will not finish parsing the document, and the service from which the parser was called will fail.
*If caching is enabled, but BigMemory is not, the enhanced XML parser uses Terracotta Ehcache to move some partitions from the heap to a local disk store.
*If caching is enabled and BigMemory is enabled, the enhanced XML parser uses Terracotta Ehcache to move some partitions from the heap to BigMemory. If the amount of BigMemory used by the enhanced XML parser exceeds the limit set by the Maximum BigMemory allocation field, the enhanced XML parser throws an UnxepectedCachingException.
In rare circumstances, the enhanced XML parser might throw the following exceptions:
*If the aggregate attribute value length for any single XML element exceeds 65535 characters, the enhanced XML parser throws an ImplementationLimitCachingException.
*If the partition size is relatively small and an individual XML element contains a very large number of attributes or the aggregate length of the attribute values for an element is very long, Integration Server might throw a PartitionSizeCachingException. To resolve this issue, increase the partition size. For more information about the partition size, see Setting the Partition Size.