Hi Shafi, this fix looks good to me. Reviewed.
Best regards Christoph > -----Original Message----- > From: serviceability-dev [mailto:serviceability-dev- > boun...@openjdk.java.net] On Behalf Of Shafi Ahmad > Sent: Donnerstag, 13. Juli 2017 10:45 > To: serviceability-dev@openjdk.java.net > Subject: [10] RFR for JDK-8169961: Memory leak after debugging session > > 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