Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fenrus110

macrumors regular
Original poster
Mar 24, 2008
142
0
My program is like the Page Control sample, except a lot more complicated. So as more and more pages are added, obviously it will run out of memory.

Now I did implement the didReceiveMemoryWarning, and my program doesn't seem to crash no matter how many pages I add.

I'm just wondering if it is okay, (or Apple think it is okay), to be relying on doing this. Should I be releasing the views on the fly instead, so that the didReceiveMemoryWarning never gets close to being called?
 

dean1012

macrumors regular
Jul 10, 2008
130
1
Don't hold memory longer than you need to on any device (not even on a computer).

With that said, didReceiveMemoryWarning is a very nice function and you should utilize it. In my app, Nexus Reference, I use it as a method of releasing data from memory that hasn't been viewed in a while.
 

caveman_uk

Guest
Feb 17, 2003
2,390
1
Hitchin, Herts, UK
The iPhone is rather short of memory and it's better to avoid your memory footprint getting large in the first place. Obviously you have to play this against the performance costs of not caching data etc...
 

gholias

macrumors newbie
Dec 17, 2008
1
0
My program is like the Page Control sample, except a lot more complicated. So as more and more pages are added, obviously it will run out of memory.

Now I did implement the didReceiveMemoryWarning, and my program doesn't seem to crash no matter how many pages I add.

I'm just wondering if it is okay, (or Apple think it is okay), to be relying on doing this. Should I be releasing the views on the fly instead, so that the didReceiveMemoryWarning never gets close to being called?


Hey fenrus110

Did you find a solution for this problem? Im having the exactly same issue

any idea about how to avoid the memory leak issuw with the pagecontrol sample?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.