Force GC after each iteration and print memory stats periodically