0

how can I set the DUMP file location for the Tanuki wrapper.

I need to write the DUMP file when the OutOfMemoryError occurs. This is configured as follows:

wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=DUMP,RESTART

But I need to store it to a different disk partition to prevent a total crash due to disk memory.

I found some JVM properties but they seem not to work:

wrapper.java.additional.18=-XX:HeapDumpPath=C:/test1

Description:

-XX:HeapDumpPath=./java_pid<pid>.hprof  Path to directory or filename for heap dump.

This one is not needed in my case --> HeapDump is being written with the above config..-XX:-HeapDumpOnOutOfMemoryError

Can anyone help me in this term. Thanks!

izocan
  • 291
  • 1
  • 4
  • 16

1 Answers1

1

The solution I use myself in production:

wrapper.java.additional.2=-XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.3=-XX:+ExitOnOutOfMemoryError
wrapper.java.additional.4=-XX:HeapDumpPath=C:/test1

In this case wrapper.filter configuration is not needed.

Note that -XX:+ExitOnOutOfMemoryError option appeared in JDK 8u92. If you use earlier version of JDK, the solution from this answer may help.

apangin
  • 92,924
  • 10
  • 193
  • 247
  • Hi thanks for your answer. I also tried it this way. but the dump files are always stored in the folder where the java application has been started. – izocan Jan 15 '18 at 17:05
  • @izocan There might be a mistake in the configuration. Check `jcmd PID VM.flags` to verify that JVM options have been applied correctly. – apangin Jan 15 '18 at 18:04
  • Thank you very much for your answers. The problem was that I started the Application within eclipse. My eclipse is starting the application with the IBM JDK and because of this the JVM Parameter is not taking action. when I started the .bat file from the WindowsExplorer everything works fine. – izocan Jan 16 '18 at 12:14