Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8353308

Provide ability to run JCmd directly on fatal error

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • hotspot
    • None
    • svc

      The -XX:OnError= option is used to run new processes, near the end of fatal error handling. This can be used to gather information at the time of a crash. It is sometimes used to call jcmd, to attach back to the crashing JVM.
      e.g.
      -XX:OnError="jcmd %p ...command..."

      The attach mechanism can be bypassed if we introduce a -XX:OnErrorJCmd= option, which runs "jcmd" diagnostics directly.

      e.g.
      -XX:OnErrorJcmd="GC.heap_dump my_dump_%p.hprof"

      While this is fatal error handling and there can be few guarantees, this may be more reliable than re-attaching.

            kevinw Kevin Walls
            kevinw Kevin Walls
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: