Make hardcoded shell invocation with -XX:OnOutOfMemoryError more flexible

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: hotspot
    • x86_64
    • linux

      ADDITIONAL SYSTEM INFORMATION :
      openjdk version "25.0.1" 2025-09-16


      A DESCRIPTION OF THE PROBLEM :
      On posix operating systems it seems that the OnOutOfMemoryError hook is hardcoded to invoke "/bin/sh -c" as wrapper: https://github.com/openjdk/jdk/blob/6b72b778039afce0e25986114d15dd29a6786529/src/hotspot/os/posix/os_posix.cpp#L2110-L2111

      This prevents usage of this feature when no shell is available, for example in hardened container images.
      It would be more flexible to be able to directly specify a binary to be executed, at least using special syntax or a different flag like OnOutOfMemoryErrorExec


            Assignee:
            Unassigned
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: