JDK 7 |
---|
7u95 b01Fixed |
Relates :
|
|
Relates :
|
The following code snippet causes failure if the file 'filename' size is greater than 1G: FileInputStream in = new FileInputStream(fileName); XMLSignatureInput a = new XMLSignatureInput(in); a.getOctetStream(); // OutOfMemoryError occurs at this line. Stack trace with failure: java.lang.OutOfMemoryError: Requested array size exceeds VM limit at com.sun.org.apache.xml.internal.security.utils.UnsyncByteArrayOutputStream.expandSize(UnsyncByteArrayOutputStream.java:100) at com.sun.org.apache.xml.internal.security.utils.UnsyncByteArrayOutputStream.write(UnsyncByteArrayOutputStream.java:64) at com.sun.org.apache.xml.internal.security.utils.JavaUtils.getBytesFromStream(JavaUtils.java:125) at com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput.getResetableInputStream(XMLSignatureInput.java:565) at com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput.getOctetStream(XMLSignatureInput.java:272) at Main.main(Main.java:10)