Clear all allocated memory.