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

NPE is thrown when JDB tries to stop in low memory notifications code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 13
    • core-svc
    • None

      Use the attached class (based on the use case attached to JDK-8170299) to reproduce the issue.

      After NPE is thrown there is no way to continue the program, command "cont" returns " Nothing suspended."

      jdb -classpath ~/src/work -Xmx32m -XX:-UseNotificationThread MemoryWarningSystem
      Initializing jdb ...
      > stop in MemoryWarningSystem$1.memoryUsageLow
      Deferring breakpoint MemoryWarningSystem$1.memoryUsageLow.
      It will be set after the class is loaded.
      > run
      run MemoryWarningSystem
      Set uncaught java.lang.Throwable
      Set deferred uncaught java.lang.Throwable
      >
      VM Started: Pool:G1 Old Gen
      Setting threashold for pool G1 Old Gen percentage:0.1
      Set deferred breakpoint MemoryWarningSystem$1.memoryUsageLow
      Notfication received:java.management.memory.threshold.exceeded
      Notfication MEMORY_THRESHOLD_EXCEEDED received:
      Memory usage low!!!

      Breakpoint hit: Exception in thread "event-handler" java.lang.NullPointerException
      at jdk.jdi/com.sun.tools.example.debug.tty.TTY.printCurrentLocation(TTY.java:250)
      at jdk.jdi/com.sun.tools.example.debug.tty.TTY.vmInterrupted(TTY.java:223)
      at jdk.jdi/com.sun.tools.example.debug.tty.EventHandler.run(EventHandler.java:81)
      at java.base/java.lang.Thread.run(Thread.java:830)
      percentageUsed = 0.3621826171875
      Setting threashold for pool G1 Old Gen percentage:0.8
      cont
      > Nothing suspended.

        1. MemoryWarningSystem.java
          4 kB
          Daniil Titov
        2. MemoryWarningSystem.java
          4 kB
          Daniil Titov

            Unassigned Unassigned
            dtitov Daniil Titov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: