[10] RFR for JDK-8169961: Memory leak after debugging session

Shafi Ahmad shafi.s.ahmad at oracle.com
Thu Jul 13 08:45:05 UTC 2017


Hi,

Please review the code change for the fix of bug 'JDK-8169961: Memory leak after debugging session'

Summary:
1.  It seems that the thread created for com.sun.tools.jdi.TargetVM.EventController is never stopped and keeps a hard  reference to the VirtualMachineImpl. This leads to VirtualMachineImpl leak after debug session is finished.  EventController is private class and member field vm of type  VirtualMachineImpl, holding the hard reference to the VirtualMachineImpl. I am not seeing the usage of filed vm so we can remove it safely.
2. Added eventController.release(); before  'Target VM interface thread exiting'
3. TargetVM gets an EventController  which is a daemon thread, but don't see the thread having a way of stopping so added code to exit as soon as TargetVM thread stops listening.

jdk10 bug: https://bugs.openjdk.java.net/browse/JDK-8169961
webrev link: http://cr.openjdk.java.net/~shshahma/8169961/webrev.00/

Testing: run jprt and I provided the FBP and  it works for them. 

Regards,
Shafi


More information about the serviceability-dev mailing list