It replaces a "bad" technique, heap exhaustion, with the "less bad" technique of calling System.gc, potentially multiple times, to clear weak references. With this change the test runs much quicker, and has not failed in several thousands of runs on a local machine.
http://cr.openjdk.java.net/~chegar/8068260/webrev.00/webrev/ -Chris.
