0

I am testing Apache Tika Server (v2.4.1) and I see that it fails for large documents with an error of:

Error 500 Server Error

HTTP ERROR 500 Server Error

URI:/rmeta/form/text STATUS:500 MESSAGE:Server Error SERVLET:- CAUSED BY:org.apache.cxf.interceptor.Fault: Java heap space CAUSED BY:java.lang.OutOfMemoryError: Java heap space
Powered by Jetty:// 9.4.46.v20220331

I am providing it these options and it fails for a PDF file of 340MB in size:

-spawnChild -JXmx6g

So, I can't figure out why this happens. Does the heap setting apply only to the parent process and not to the spawned child process?

Am I missing something or I simply need more heap space?

From the looks of it, the child process fails while using only 2GB of RAM, so pretty far away from the 6GB limit specified...

user2173353
  • 4,316
  • 4
  • 47
  • 79
  • 2
    just to be sure you have more than 6GB of ram right? also, you are running 64-bit version of the jdk right? – Bagus Tesa Jun 20 '22 at 13:20
  • @BagusTesa Yes, and I use the Microsoft JDK (x64), if that matters. – user2173353 Jun 20 '22 at 13:50
  • 1
    btw, i just noticed before your `-Xmx` flag, it had a `J`. i'm not well aware of that flag, is it intentional? going by your description, tika only takes 2gb which meant the maximum heap size still uses the default one. – Bagus Tesa Jun 20 '22 at 15:22
  • @BagusTesa Yes, it is intentional. I was following the documentation here: https://cwiki.apache.org/confluence/display/TIKA/TikaServer . Quote: `NOTE 2: to specify the JVM args for the child process, prepend the arguments with -J as in -JXmx4g after....`. – user2173353 Jun 21 '22 at 07:35
  • i see, try using both `-Xmx` and `-JXmx` flags then. – Bagus Tesa Jun 21 '22 at 09:51

0 Answers0