1

I am trying to read a very large flat file of around 1 GB using Camel. The records are separated by a set of strings, and I am trying the below route.

from(incomingFilePath+"?delete=true")
                .split()
                .tokenize("ENDRECORD")
                .streaming()
                .bean(bean, "method")
                .bean(bean,"method")
                .end();

The streaming works in the above case. But when I try to tokenize using a regex, my streaming fails and I am getting an Out of Memory Exception.

from(incomingFilePath+"?delete=true")
                .split()
                .tokenize("\\|END(\\r\\n|\\r|\\n)", true)
                .streaming()
                .bean(bean, "method")
                .bean(bean,"method")
                .end();

java.lang.OutOfMemoryError: Java heap space

Some references:

Halley
  • 521
  • 10
  • 35

0 Answers0