Usage:
-XX:OnOutOfMemoryError="< cmd args >;< cmd args >"
Examples:
Running this will instruct JVM to restart the server after out of memory error occurred:
-XX:OnOutOfMemoryError="shutdown -r"
Description:
For a large-scale enterprise application, it is very common to consume bigger amount of memory on the server. If the server characteristics were chosen incorrectly, or workload increased and there is no enough memory it is common scenario to face an out of memory error, which will result in an application crash. It’s a critical scenario, which might be hard to replicate and fix. In order to help in this situation JVM comes with a bunch of helpful parameters, one of which is OnOutOfMemoryError, which is used in conjunction with HeapDumpOnOutOfMemoryError. What it does is that instructs the with command line arguments which should be executed in case of OutOfMemoryError.
Default Value;
By default it is disabled.
Errors:
None
Arguments related:
TODO link HeapDumpOnOutOfMemoryError, HeapDumpPath
Related Posts
NOTE:
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.
Edit your Comment