Some how find a better way to manage heap when rebuilding the files on the server. I currently have no great ideas on how to do this.