[
https://issues.apache.org/jira/browse/XERCESJ-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414371#comment-13414371
]
Mukul Gandhi commented on XERCESJ-1573:
---------------------------------------
I would agree that, using assertions is more resource consuming than lot of
other XSD constructs.
The Xerces implementation, builds a full XDM tree and maintains a stack to
traverse nested assertions. Assertions also requires instantiating the XPath
2.0 engine, and asking it to evaluate assertions. The advise to save memory
during XSD validation is, to use assertions only when you need them and declare
them down the XML tree as much as possible (so that the assert XDM tree
footprint is small).
In your specific <assert> example (i.e, xsd:dateTime(@end) le
(xsd:dateTime(@start) + xsd:dayTimeDuration('P1D'))), the <assert> XPath 2.0
engine may be following an expensive evaluation path (I haven't analyzed this
case really, but as a general rule certain XPath expressions may result in poor
runtime performance).
I'm not sure just now, how we can approach to make the implementation better
for your bug report. Also not sure whether it's right to classify this issue as
Bug->blocker. May be a less severe classification of this is more appropriate
(improvement etc).
> Possible memory leak when using assertions
> ------------------------------------------
>
> Key: XERCESJ-1573
> URL: https://issues.apache.org/jira/browse/XERCESJ-1573
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema 1.1 Datatypes
> Affects Versions: 2.11.0
> Reporter: Jorge L. Williams
> Priority: Blocker
> Attachments: d1.png, d2.png, duration-sans-assert.xsd, duration.xsd,
> good.xml
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]