JDK-8175792 : Release Note: OOME caused by very large CDATA section in XML document can now be avoided
  • Type: Sub-task
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2017-02-23
  • Updated: 2017-10-20
  • Resolved: 2017-03-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Description
An event-based XML parsers may return character data in chunks.
 
>SAX specification: states that SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks.
 
>StAX specification: did not specify explicitly.
 
   The JDK implementation before JDK 9 returns all character data in a CData section in a single chunk by default. As of JDK 9, an implementation-only property `jdk.xml.cdataChunkSize` is added to instruct a parser to return the data in a CData section in a single chunk when the property is zero or unspecified, or in multiple chunks when it is greater than zero. The parser will split the data by linebreaks, and any chunks that are larger than the specified size to ones that are equal to or smaller than the size.
 
>The property `jdk.xml.cdataChunkSize` is supported through the following means:

1. through the SAX or StAX API, that is `SAXParser` or `XMLReader` for SAX, and `XMLInputFactory` for StAX. If the property is set, its value will be used in preference over any of the other settings.
2. as a system property. The value set in the system property will overwrite that in jaxp.properties, but may be overridden by the API setting above.
3. in the `jaxp.properties` file. The value in `jaxp.properties` may be overridden by the system property or an API setting.