Project

Profile

Help

Bug #2754

closed

Memory leak of an instance model from a schema containing QName valued elements

Added by Stuart Barker over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Sprint/Milestone:
-
Start date:
2016-05-23
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6, 9.7, trunk
Fix Committed on Branch:
9.6, 9.7, trunk
Fixed in Maintenance Release:
Platforms:

Description

We have been profiling our code after upgrading to Saxon 9.7, and there appears to be a leak of the model of an instance document from the schema grammar where the latter contains elements whose type is derived from xs:QName.

Examining the heap of the attached code sample should demonstrate that the model (in this case a TinyTree) for "instance.xml" is still referenced from the processor's schema model even after processing is finished.

In our case the leak is significant. We are attempting to process XML instances with on-disk size of up to 400Mb and we are using an implementation of NodeInfo backed by a DOM-based model, which results in a leak of several Gb. In our workflow several schema grammars will typically be retained for a long period and have multiple instance documents processed against them. This means that multiple leaked models will exist in memory at the same time as the model for the latest instance.

The profiler results show the following chain of references: UserAtomicType -> StringConverter -> InscopeNamespaceResolver -> impl of NodeInfo. No such chain of references existed in Saxon 9.3 but the problem does seem to affect 9.6 as well.


Files

instanceModelLeak.zip (1.52 KB) instanceModelLeak.zip Stuart Barker, 2016-05-23 16:59

Please register to edit this issue

Also available in: Atom PDF