mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-163334 Memory leak in jdi code - workaround for normal process finish
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -383,14 +383,15 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
|
||||
catch (UnsupportedOperationException e) {
|
||||
LOG.info(e);
|
||||
}
|
||||
|
||||
if (Patches.JDK_BUG_EVENT_CONTROLLER_LEAK) {
|
||||
// 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();
|
||||
finally {
|
||||
if (Patches.JDK_BUG_EVENT_CONTROLLER_LEAK) {
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user