Added call to gc() after growing each tree, to free memory for the next one.