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.
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.
- relates to
-
JDK-8170299 Debugger does not stop inside the low memory notifications code
-
- Resolved
-