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

(thread) uncaught exception handler can be silenced by OutOfMemoryError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 5.0, 7, 9
    • core-libs
    • Fix Understood
    • generic
    • generic

      The attached program MemoryEater1 triggers multiple OutOfMemoryErrors and
      eventually exits due to OOME. However, no message about the exception is
      printed. The only indication an exception occurred is the non-zero exit
      status.

      $ $JAVA_HOME/bin/java -client -showversion -Xmx128m MemoryEater1
      java version "1.6.0-ea"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b58)
      Java HotSpot(TM) Client VM (build 1.6.0-ea-b58, mixed mode)
      $ echo $?
      1

      jdk1.5.0 behaves similarly.

      The 1.4.2 jdk at least printed a message indicating an exception
      occurred, although the message was incomplete (the type of the
      exception and newline were missing):

      $ $JAVA_HOME/bin/java -client -showversion -Xmx128m MemoryEater1
      java version "1.4.2_07"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)

      Exception in thread "main"$
      $ echo $?
      1

            Unassigned Unassigned
            jcoomes John Coomes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: