Hello Shafi,

A couple of comments:

Line 182: Here, eventController.release() is called after the 'vm' is disposed. 
And eventController.release() causes the following statement to be executed on 
the eventcontroller thread after the 'vm' is disposed:

JDWP.VirtualMachine.ReleaseEvents.process(vm);

Which does not seem to be right. Someone from the Serviceability group can 
confirm the correctness of this change.

Line 330: Instance variable 'VirtualMachineImpl vm' is removed from the 
EventController class. It is being used further down in its run() method. So I 
think it cannot be removed.

Thanks,
Poonam
 

> -----Original Message-----
> From: Shafi Ahmad
> Sent: Thursday, July 13, 2017 1:45 AM
> To: serviceability-dev@openjdk.java.net
> Cc: Poonam Parhar (poonam.ba...@oracle.com)
> 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

Reply via email to