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

-XX:OnOutOfMemoryError does not work if supplied twice on windows

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b21
    • CPU:
      generic
    • OS:
      windows

      Backports

        Description

        FULL PRODUCT VERSION :
        JREVERSION=1.8.0_65_x64

        ADDITIONAL OS VERSION INFORMATION :
        Windows Server2021R2

        A DESCRIPTION OF THE PROBLEM :
        Due to my mistake the bat file for starting java included the parameter "-XX:OnOutOfMemoryError" two times.

        So my configuration is like this

        JAVAVMPROPS=-server -Dcom.sun.management.jmxremote -verbose:gc -XX:CompileCommand="exclude,sun.reflect.MethodAccessorImpl::<init>" -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-TraceClassUnloading -XX:-HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError="c:\systems\bin\XStopServerOOM.cmd" -Dplatform.logbuffered.enabled=true

        JAVADEBUGPROPS=-Xms2048M -Xmx2048M -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError="c:\systems\bin\XStopServerOOM.cmd"

        And to start the java program:
        ${JAVAHOME}\bin\java.exe ${JAVAVMPROPS} ${JAVADEBUGPROPS}

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Configure the parameter "-XX:OnOutOfMemoryError" two times and generate an out of memory to verify that "-XX:OnOutOfMemoryError" has no effect.


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        I would expect the last "-XX:OnOutOfMemoryError" to be executed
        ACTUAL -
        The bat file that I have configured (via "-XX:OnOutOfMemoryError") to be executed in case of an OutOfMem is not executed.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        CUSTOMER SUBMITTED WORKAROUND :
        Fixed my configuration to only include "-XX:OnOutOfMemoryError" one time and now it's working.

          Attachments

          1. MemTest.java
            0.4 kB
          2. win.bat
            0.0 kB

            Issue Links

              Activity

                People

                Assignee:
                vkempik Vladimir Kempik
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: