Made it force GC between runs like the equivalent Java implementation.