diff --git a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java index 3b6517183b63..4566d5b30221 100644 --- a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java +++ b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java @@ -19,8 +19,6 @@ import com.intellij.util.ExceptionUtil; import com.intellij.util.containers.ConcurrentLongObjectMap; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.SmartHashSet; -import gnu.trove.THashMap; -import gnu.trove.THashSet; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -46,13 +44,15 @@ public class CoreProgressManager extends ProgressManager implements Disposable { private ScheduledFuture myCheckCancelledFuture; // guarded by threadsUnderIndicator // indicator -> threads which are running under this indicator. guarded by threadsUnderIndicator. - private static final Map> threadsUnderIndicator = new THashMap<>(); + // THashMap is avoided here because of tombstones overhead + static final Map> threadsUnderIndicator = new HashMap<>(); // the active indicator for the thread id private static final ConcurrentLongObjectMap currentIndicators = ContainerUtil.createConcurrentLongObjectMap(); // top-level indicators for the thread id private static final ConcurrentLongObjectMap threadTopLevelIndicators = ContainerUtil.createConcurrentLongObjectMap(); // threads which are running under canceled indicator - static final Set threadsUnderCanceledIndicator = new THashSet<>(); // guarded by threadsUnderIndicator + // THashSet is avoided here because of possible tombstones overhead + static final Set threadsUnderCanceledIndicator = new HashSet<>(); // guarded by threadsUnderIndicator private static volatile boolean shouldCheckCanceled; /** active (i.e. which have {@link #executeProcessUnderProgress(Runnable, ProgressIndicator)} method running) indicators