Apache Tika keeps dying

789 Views Asked by At

I am using openEdgar to parse SEC filings data and it uses Apache Tika to parse HTML, XML and LBRL content. I am running this on a box with 4G of memory and it keeps dying on me.

I ended up starting it this way:

java -Dlog4j.configuration=file:log4j.xml -jar tika-server-1.19.1.jar -spawnChild

and in the logs I see how it will eventually fail to ping the child process and things just go downhill from there and JVM will die with insufficient memory to proceed:

2018-12-20 19:17:29 DEBUG WriteFlusher:434 - Flushed=true written=32776 remaining=0 WriteFlusher@575678bd{WRITING}->null
2018-12-20 19:42:25 INFO  TikaServerCli:115 - Starting Apache Tika 1.19.1 server
2018-12-20 19:49:37 WARN  TikaServerWatchDog:191 - Exception pinging child process
    ...java.io.IOException: Stream closed
2018-12-20 19:49:37 WARN  TikaServerWatchDog:213 - Exception asking child to shutdown
    ...java.io.IOException: Stream closed
2018-12-20 19:49:37 WARN  TikaServerWatchDog:225 - Problem shutting down writer to child
   ...java.io.IOException: Stream closed
2018-12-20 19:49:37 INFO  TikaServerWatchDog:97 - About to restart the child process
2018-12-20 19:49:40 INFO  TikaServerWatchDog:99 - Successfully restarted child process -- 1 restarts so far)
2018-12-20 19:53:15 WARN  TikaServerWatchDog:197 - Received status from child: TIMEOUT
2018-12-20 19:53:20 WARN  TikaServerWatchDog:213 - Exception asking child to shutdown
    ...java.io.IOException: Stream closed
2018-12-20 19:53:20 WARN  TikaServerWatchDog:225 - Problem shutting down writer to child
    ...java.io.IOException: Stream closed
2018-12-20 19:53:20 INFO  TikaServerWatchDog:97 - About to restart the child process
2018-12-20 19:53:34 INFO  TikaServerWatchDog:99 - Successfully restarted child process -- 2 restarts so far)
2018-12-20 19:55:00 WARN  TikaServerWatchDog:202 - Exception receiving status from child
java.lang.ArrayIndexOutOfBoundsException: 35 is not acceptable for an array of length 6
2018-12-20 19:55:08 ERROR TikaServerCli:120 - Can't start: 
    java.io.IOException: Unrecognized status code; message:
    #
    # There is insufficient memory for the Java Runtime Environment to continue.
    # Native memory allocation (mmap) failed to map 65536 bytes for committing reserved memory.

Is there anything else I could do to understand the root cause of this and potentially fix it?

0

There are 0 best solutions below