I am trying to understand the conditions that cause the iOS system to restart an application that has been terminated due to memory pressure. Creating sufficient memory pressure was difficult.
Currently, my approach is to run my application through Xcode, create it, and run a helper application that eats memory. It allocates a bit of memory in the NSTimer loop until the iOS system kills it. When I'm lucky, Xcode tells me that my main application was “terminated due to memory pressure”.
I am looking for a more reliable way to achieve this. Are there any memory allocation methods or private APIs that are better suited for this purpose?
source
share