[MGNLUI-1917] Export leads to OOME Created: 09/Aug/13  Updated: 16/Aug/13  Resolved: 13/Aug/13

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.0, 5.0.1
Fix Version/s: 5.0.2, 5.1

Type: Bug Priority: Critical
Reporter: Will Scheidegger Assignee: Eric Hechinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Apache Tomcat with only 1 Magnolia instance and 1GB of RAM


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Tried to export a bunch of assets from DAM and ran into an OutOfMemoryException pretty much instantly – despite the generous setup (see environment). This used to work flawlessly in Magnolia < 5.

Last part of the stack trace:

Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
at java.lang.StringBuffer.append(StringBuffer.java:232)
at org.apache.xml.serialize.IndentPrinter.breakLine(Unknown Source)
at org.apache.xml.serialize.IndentPrinter.breakLine(Unknown Source)
at org.apache.xml.serialize.XMLSerializer.endElementIO(Unknown Source)
at org.apache.xml.serialize.XMLSerializer.endElement(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
at info.magnolia.importexport.filters.MetadataUuidFilter.endElement(MetadataUuidFilter.java:111)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
at info.magnolia.importexport.filters.SkipNodeFilter.endElement(SkipNodeFilter.java:105)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
at info.magnolia.importexport.filters.VersionFilter.endElement(VersionFilter.java:87)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at info.magnolia.importexport.DataTransporter.readFormatted(DataTransporter.java:567)
at info.magnolia.importexport.DataTransporter.readFormatted(DataTransporter.java:542)
at info.magnolia.importexport.DataTransporter.parseAndFormat(DataTransporter.java:524)
at info.magnolia.importexport.DataTransporter.executeExport(DataTransporter.java:468)
at info.magnolia.commands.impl.ExportCommand.execute(ExportCommand.java:107)
at info.magnolia.commands.MgnlCommand.executeSynchronized(MgnlCommand.java:84)



 Comments   
Comment by Eric Hechinger [ 13/Aug/13 ]

Root issue is the conversion from an OutputStream to an InputStream.
Base on the following doc,
http://code.google.com/p/io-tools/wiki/ConvertOutputStreamInputStream

the first solution was implemented and in fact for large file, we got OOME....

Now we implemented the second solution with a specific handling of tmp file removal.

Generated at Mon Feb 12 08:51:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.