We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05d97db commit 1a9af7bCopy full SHA for 1a9af7b
utils/test-utils/src/main/java/datadog/trace/test/util/GCUtils.java
@@ -22,6 +22,8 @@ public static void awaitGC(final WeakReference<?> ref) throws InterruptedExcepti
22
23
public static void awaitGC(final WeakReference<?> ref, final long duration, final TimeUnit unit)
24
throws InterruptedException {
25
+ System.gc();
26
+ System.runFinalization();
27
final long waitNanos = unit.toNanos(duration);
28
final long start = System.nanoTime();
29
while (System.nanoTime() - start < waitNanos) {
0 commit comments