Manually invoke garbage collection to improve memory usage