Clean up of memory class