#483 OutOfMemory with multiple large documents

v8.7
closed
5
2012-10-08
2006-03-07
Michael Kay
No

An OutOfMemory error can occur when several large
documents are loaded in a session.

Saxon 8.7 introduces a simple learning algorithm to
decide how much space to allocate when a new document
is created, based on the average size of the documents
previously created in the session. If this average size
exceeds 64K characters, the algorithm allocates excess
space for subsequent documents and this can lead to an
OutOfMemory error.

Source fix: in net.sf.saxon.tinytree.LargeStringBuffer,
line 49, change

this.minAllocation = minAllocation;

to

this.minAllocation =
Math.min(minAllocation, maxAllocation);

Michael Kay

Discussion