From 2dedd75cd7223859351ce1ebacb6cba2163552fa Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 9 May 2019 12:06:01 +0200 Subject: [PATCH] Add comment about Thread.yield() in MemoryLeakTestUtil --- .../java/org/jivesoftware/smack/util/MemoryLeakTestUtil.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smack-core/src/test/java/org/jivesoftware/smack/util/MemoryLeakTestUtil.java b/smack-core/src/test/java/org/jivesoftware/smack/util/MemoryLeakTestUtil.java index f85b77469..7e41d5793 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/util/MemoryLeakTestUtil.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/util/MemoryLeakTestUtil.java @@ -132,6 +132,8 @@ public class MemoryLeakTestUtil { throw new AssertionError("No observed gargabe collection after " + gcCalls + " calls of System.gc()"); } System.gc(); + // TODO: Would a Thread.yield() here improve the chances of a full GC? It appears that on some systems we + // observe a partial GC here. gcCalls++; } while (weakReference.get() != null);