From 1d64a6e867d5e71449b66fa9ced10309eefac1d4 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 19 Jan 2015 13:57:31 +0300 Subject: [PATCH] moved to testFramework --- .../{util => testFramework}/src/com/intellij/util/GCUtil.java | 3 +++ 1 file changed, 3 insertions(+) rename platform/{util => testFramework}/src/com/intellij/util/GCUtil.java (96%) diff --git a/platform/util/src/com/intellij/util/GCUtil.java b/platform/testFramework/src/com/intellij/util/GCUtil.java similarity index 96% rename from platform/util/src/com/intellij/util/GCUtil.java rename to platform/testFramework/src/com/intellij/util/GCUtil.java index b1a4da43afa3..6c1762a7f2f2 100644 --- a/platform/util/src/com/intellij/util/GCUtil.java +++ b/platform/testFramework/src/com/intellij/util/GCUtil.java @@ -16,6 +16,7 @@ package com.intellij.util; import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.TestOnly; import java.lang.ref.ReferenceQueue; import java.lang.ref.SoftReference; @@ -27,6 +28,7 @@ public class GCUtil { * Try to force VM to collect all the garbage along with soft- and weak-references. * Method doesn't guarantee to succeed, and should not be used in the production code. */ + @TestOnly public static void tryForceGC() { tryGcSoftlyReachableObjects(); WeakReference weakReference = new WeakReference(new Object()); @@ -40,6 +42,7 @@ public class GCUtil { * Try to force VM to collect soft references if possible. * Method doesn't guarantee to succeed, and should not be used in the production code. */ + @TestOnly public static void tryGcSoftlyReachableObjects() { ReferenceQueue q = new ReferenceQueue(); SoftReference ref = new SoftReference(new Object(), q);