OutOfMemory error

43 views
Skip to first unread message

Elizabeth John

unread,
Apr 22, 2024, 2:28:09 PMApr 22
to Smooks Users
Hello

I am encountering an OutOfMemory error while using smooks library to filter source with over 45K 837I claims.
smooks.filterSource results in the following
java.lang.OutOfMemoryError: Requested array size exceeds VM limit

and the control is lost such that the application is unable to catch the exception and exit gracefully.

Appreciate any feedback.
Thanks!
Liz



Claude

unread,
Apr 23, 2024, 3:20:29 AMApr 23
to Smooks Users
We need further info for the community to diagnose what the problem is. Like, which version of Smooks are you running? How are you configuring the app? What's the input? Could you post the complete exception stack trace?

Claude

Elizabeth John

unread,
Apr 24, 2024, 11:01:16 AMApr 24
to Smooks Users
Hi Claude

Thank you for your response.

We have a Spring Boot java service running as a container on a Docker environment. This service consumes messages from RabbitMQ.
When we load an 837I file (size=46MB) with 45K plus CLM segments it throws the below exception

Exception resulted when parsing position 1 of 1:Smooks Filtering operation failed. Cause:java.lang.OutOfMemoryError: Java heap space
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
at java.lang.StringBuffer.append(StringBuffer.java:270)
at java.io.StringWriter.write(StringWriter.java:101)
at org.milyn.delivery.sax.SAXElementWriterUtil.writeUnclosedElement(SAXElementWriterUtil.java:122)
at org.milyn.delivery.sax.SAXElementWriterUtil.writeStartElement(SAXElementWriterUtil.java:43)
at org.milyn.delivery.sax.DefaultSAXElementSerializer.writeStart(DefaultSAXElementSerializer.java:83)
at org.milyn.delivery.sax.DefaultSAXElementSerializer.writeStartElement(DefaultSAXElementSerializer.java:71)
at org.milyn.delivery.sax.DefaultSAXElementSerializer.onChildText(DefaultSAXElementSerializer.java:51)
at org.milyn.delivery.sax.SAXHandler._characters(SAXHandler.java:469)
at org.milyn.delivery.sax.SAXHandler.characters(SAXHandler.java:414)
at org.milyn.edisax.EDIParser.indent(EDIParser.java:927)
at org.milyn.edisax.EDIParser.startElement(EDIParser.java:867)
at org.milyn.edisax.EDIParser.startElement(EDIParser.java:862)
at org.milyn.edisax.EDIParser.startElement(EDIParser.java:857)
at org.milyn.edisax.EDIParser.mapComponent(EDIParser.java:691)
at org.milyn.edisax.EDIParser.mapField(EDIParser.java:636)
at org.milyn.edisax.EDIParser.mapFields(EDIParser.java:606)
at org.milyn.edisax.EDIParser.mapSegment(EDIParser.java:564)
at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:535)
at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:538)
at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:538)
at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:538)
at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:538)
at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:538)
at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:453)
at org.milyn.edisax.EDIParser.parse(EDIParser.java:428)
at org.milyn.edisax.EDIParser.parse(EDIParser.java:386)
at org.milyn.smooks.edi.EDIReader.parse(EDIReader.java:111)
at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76)
at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)

springBootVersion = '2.1.1.RELEASE'
Java = 1.8
org.milyn:milyn-smooks-edi:1.7.1
com.rabbitmq:amqp-client:5.4.3
Org.springframework.amqp:spring-amqp:2.1.2.release

Thanks
Elizabeth

Claude Mamo

unread,
Apr 27, 2024, 4:38:48 AMApr 27
to smook...@googlegroups.com
I reckon that the EDI reader is consuming more character data than the default XML serialiser can chew on. As a side note, this shouldn't happen in v2. Have you tried allocating more heap memory to the Java process?

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/1c840662-6e8d-45a7-b1d8-b44224ebac96n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages