free all unused memory, files closed