mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-163334 Memory leak - workaround
This commit is contained in:
@@ -26,11 +26,13 @@ import com.intellij.debugger.engine.evaluation.EvaluateException;
|
||||
import com.intellij.debugger.engine.jdi.VirtualMachineProxy;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ReflectionUtil;
|
||||
import com.intellij.util.ThreeState;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.EventQueue;
|
||||
import com.sun.jdi.request.EventRequestManager;
|
||||
import com.sun.tools.jdi.TargetVM;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -330,6 +332,15 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
|
||||
catch (UnsupportedOperationException e) {
|
||||
LOG.info(e);
|
||||
}
|
||||
|
||||
// Memory leak workaround, see IDEA-163334
|
||||
TargetVM target = ReflectionUtil.getField(myVirtualMachine.getClass(), myVirtualMachine, TargetVM.class, "target");
|
||||
if (target != null) {
|
||||
Thread controller = ReflectionUtil.getField(target.getClass(), target, Thread.class, "eventController");
|
||||
if (controller != null) {
|
||||
controller.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void exit(int i) {
|
||||
|
||||
Reference in New Issue
Block a user