You Dispose them once you're done using them. Eg, when you would otherwise discard the objects.
On Thu, Aug 30, 2012 at 5:11 PM, Steven Thewissen <[email protected]>wrote: > Rodrigo, > > Thanks for your answer. I use some web views in my application which I > initialize and put onto my ViewControllers view. After that I'm basically > done with them and don't reference them in code again in the lifecycle of > that screen. They're just there for showing information. I'm fairly new to > this, so I'm wondering when to dispose them? Straight after putting them > into the view in LoadView? Or is there another moment I can get rid of them > and any other controls when theyre added to the view (I'm using Xib-less > screens)? > > I also use an AVPreview and AVStillImageOutput to take a picture in my > app, which takes up quite some memory. Not sure how I could optimize the > memory usage of that screen, which is, by far the heaviest in load. > Especially on my iPhone 3GS testdevice, it's quite a memorydrainer. > > Regards, > > Steven > > Op 30 aug. 2012 om 17:47 heeft Rodrigo Kumpera <[email protected]> het > volgende geschreven: > > I think the best way to look into this is that your App should not need to > handle memory warnings. > If it receives one, it might be too late to do anything. > > The way to handle it is the same of keeping your memory usage down. > Explicitly dispose > all your large objects as soon as you're done with them. Pay > special attention to webviews, > uicontrollers and images. > > > > On Mon, Aug 27, 2012 at 7:24 AM, devnl <[email protected]> wrote: > >> I'm fairly new at MonoTouch development and am currently looking into >> memory >> management. I have some AVFoundation code based on the CaptureManager >> example from Xamarin which throws the DidReceiveMemoryWarning message. >> Therefore I started reading up on the matter. I have figured out that >> implementing ViewDidUnload and DidReceiveMemoryWarning is a common >> practice, >> but am unsure as to what both method implementations usually look like. >> >> Currently I'm setting all my member variables to null in ViewDidUnload and >> DidReceiveMemoryWarning is basically doing nothing. I'm using a >> NavigationController to handle the navigation and have read that clearing >> all the views that aren't shown from memory is also recommended but I >> haven't really figured out how. Is there any best practice that people use >> to implementing these two methods? >> >> Another thing I'm wondering is the following. If I have a ViewController >> which I push onto the NavigationController and push a new instance of the >> same ViewController again later in the application flow, do both instances >> stay in memory? >> >> Thanks in advance, >> >> devnl >> >> >> >> -- >> View this message in context: >> http://monotouch.2284126.n4.nabble.com/What-s-best-practice-in-implementing-DidReceiveMemoryWarning-tp4656729.html >> Sent from the MonoTouch mailing list archive at Nabble.com. >> _______________________________________________ >> MonoTouch mailing list >> [email protected] >> http://lists.ximian.com/mailman/listinfo/monotouch >> > >
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
