Added error message when all the memory has been used up.