When my loop runs for about 15k times too much memory is consumed. It’s even going beyond 1 GB. What I am doing inside the loop is a series of Core data entity updating/creation. Is there any way I could control the memory usage?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you should use autorelease pools inside your loop. Here is the official Apple note about this, and if you use ARC in your project, this answer will be helpful.