Get a java.lang.StackOverflowError when indexing in ES

Hey guys,

I got an java.lang.StackOverflowError when I was indexing some logs. Does someone know where this came from ( I am not using recursive function at all). Here are some sepecifics:

  • Java version: 1.8
  • ES and Java API: 1.7.2
  • Memory given to ES: 8G (elasticsearch -Xms8g -Xmx8g)
  • Indexing with bulkprocessor:
    .setBulkActions(1000)
    .setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB))
    .setConcurrentRequests(1)

Thanks,
Cody

Can you share the full stack trace that shows the StackOverflowError?

Sure. Here it is. Just a quick note to let you know that I am using my own regex to parse logs by myself, which is the first step of my Java program. I have used it to parse several month of data. Never seen this error until today. Thanks

...in thread "main" java.lang.StackOverflowError
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615)
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4466)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3694)
at java.util.regex.Pattern$Branch.match(Pattern.java:4502)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)

This indeed looks very much like it's going to be an error on your side because

...in thread "main" java.lang.StackOverflowError

indicating its on your main thread. Is there more to the stack trace than that that includes any methods from a sub-package of org.elasticsearch?

Thanks. It is indeed an error on my side. Short answer is that there is some problem with java built-in regex when parsing long string. Just for a reference if someone else found this thread.