postpone enable collection with low priority

GitOrigin-RevId: e9bef169418e6571eb6aa50bf762b4c86035c96b
This commit is contained in:
Egor Ushakov
2019-07-24 11:30:28 +03:00
committed by intellij-monorepo-bot
parent 79860a0ad7
commit a06fbfaf0d
@@ -1121,7 +1121,12 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
// assertThreadSuspended(thread, context);
if (!Patches.IBM_JDK_DISABLE_COLLECTION_BUG) {
// ensure args are not collected
StreamEx.of(myArgs).select(ObjectReference.class).forEach(DebuggerUtilsEx::enableCollection);
for (Value arg : myArgs) {
if (arg instanceof ObjectReference) {
getManagerThread()
.schedule(PrioritizedTask.Priority.LOWEST, () -> DebuggerUtilsEx.enableCollection((ObjectReference)arg));
}
}
}
}
}