Hi All,

Please review the fix for the bug,

JDK-8170299 - Debugger does not stop inside the low memory notifications code
<https://bugs.openjdk.java.net/browse/JDK-8170299>
webrev at,

http://cr.openjdk.java.net/~hb/8170299/webrev.00/

Description of the fix:

The debugger does not stop inside the listeners registered for notification from

1. com.sun.management.GarbageCollectorMXBean 2. sun.management.MemoryImpl 
(MemoryMXBean)
3. com.sun.management.DiagnosticCommandMBean

The listeners registered for above MBeans are invoked by 'ServiceThread' which 
is a hidden thread and is not visible to the debugger.

This issue was was already worked on before and below is the review thread for 
the same.

http://mail.openjdk.java.net/pipermail/serviceability-dev/2017-September/021782.html
http://mail.openjdk.java.net/pipermail/serviceability-dev/2017-December/022611.html

With the current fix, all the user registered callbacks for above MBeans are executed in a newly created SingleThreadExecutor. The above file is also re-factored to use CopyOnWriteArrayList for managing the listeners.

The fix has been tested in Mach5 by running all the tests under open/:jdk_management and closed/:jdk_management. The tests under open/test/jdk/java/lang/management/MemoryMXBean cover the above code changes. I can add more tests in the subsequent reviews if need arises.

Please review the above change and let me know your comments.

Thanks
Harsha



Reply via email to