Adrian Grigore
Adrian Grigore

Reputation: 33318

How much memory am I allowed to allocate in Monotouch?

The question says it all - I'd like to know how much memory am I allowed to allocate before my app will eventually be killed by iOS. This is assuming that I still hold references to that memory, so it will not be GC'd.

Thanks,

Adrian

Upvotes: 2

Views: 478

Answers (1)

Praveen S
Praveen S

Reputation: 10393

You can allocate as much as you want until you receive a memory warning. There is no limit but general comments i have read the mark to be around 3Mb. :-)

Each view controller gets the message - (void)didReceiveMemoryWarning which is when you need to dealloc cached images etc to free the memory before you app gets terminated by the OS. In case you program optimally you should be able to do so with handling the memory warning.


The same applies to monotouch as the method to override would be

public override void ReceiveMemoryWarning(UIApplication application)

according to this question.

Upvotes: 4

Related Questions