From c146d91b9aa523522a779ffd9c5ba550c7a55082 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 28 Jul 2015 16:13:43 +0200 Subject: [PATCH] Force a collection at the beginning of TestRuntime to make a collection while allocating the array less likely. Fixes #1772. --- tests/org/mozilla/gc/TestRuntime.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/org/mozilla/gc/TestRuntime.java b/tests/org/mozilla/gc/TestRuntime.java index 3d3f86b3..2f5e5e7c 100644 --- a/tests/org/mozilla/gc/TestRuntime.java +++ b/tests/org/mozilla/gc/TestRuntime.java @@ -9,6 +9,10 @@ public class TestRuntime implements Testlet { public int getExpectedKnownFail() { return 0; } public void test(TestHarness th) { + System.out.println("freeMemory0: " + Runtime.getRuntime().freeMemory()); + + Runtime.getRuntime().gc(); + long totalMemory = Runtime.getRuntime().totalMemory(); long freeMemory = Runtime.getRuntime().freeMemory();