Function for memory detection done