0

openEdgar用来解析 SEC 文件数据,它使用 Apache Tika 来解析 HTML、XML 和 LBRL 内容。我在一个有 4G 内存的盒子上运行它,它一直在我身上死去。

我最终以这种方式开始:

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

在日志中,我看到它最终将如何无法 ping 子进程,事情从那里开始走下坡路,JVM 将因内存不足而死去继续:

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.

我还能做些什么来了解这个问题的根本原因并可能解决它吗?

4

0 回答 0