didReceiveMemoryWarning is a method called by the iOS system to tell your app to deallocate recreate-able assets when device memory reaches a critical level.
Questions tagged [didreceivememorywarning]
185 questions
35
votes
2 answers
How to implement didReceiveMemoryWarning in Swift?
Whenever I create a new View Controller subclass, Xcode automatically adds the method
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated
}
Usually I just delete it or…

Suragch
- 484,302
- 314
- 1,365
- 1,393
22
votes
7 answers
Received memory warning. Level=1 when showing a UIImagePickerController
This is driving me crazy!!!
I'm getting a "Received memory warning. Level=1" whenever I attempt to show a UIImagePickerController with a sourceType = UIImagePickerControllerSourceTypeCamera.
Here is the code from my viewDidLoad where I set things…

wgpubs
- 8,131
- 15
- 62
- 109
16
votes
3 answers
iOS 6 deprecation of viewWillUnload & move to didReceiveMemoryWarning
I'm new developer about to launch my first app. I'm confused about the deprecation of viewDidUnload as described below in Apple's iOS 6 release notes:
In iOS 6, the viewWillUnload and viewDidUnload methods of
UIViewController are now deprecated.…

Orpheus Mercury
- 1,617
- 2
- 15
- 30
11
votes
1 answer
What is the proper way to unload views in iOS 6 in a memory warning (Apple doc flaw)?
In iOS 6, viewWillUnload and viewDidUnload are deprecated and UIViewControllers no longer unload views that are not visible on screen during a memory warning. The View Controller Programming Guide has an example of how to manually restore this…

XJones
- 21,959
- 10
- 67
- 82
10
votes
3 answers
Memory Warning UIImagepickerController IOS 7
Could anybody help me with this issue I'm a bit new to objective c and iOS. I've been working on it but I can't figure out how to fix the problem, My app is really simple it only start the camera take pictures and send them through email to our…

cesar trujillo cetina
- 103
- 1
- 4
8
votes
2 answers
Blank screen for iOS 5 tab after dismissing modal and coming back from background after a memory warning
Run a app with tabs using iOS 5 simulator or device
Bring up a modal dialog
Simulate memory warning (for devices go to some apps that are memory intensive)
Switch to another app (if you have not done so already)
Come back to the app
Dismiss the…

cpungaliya
- 228
- 3
- 7
8
votes
2 answers
Not getting didReceiveMemoryWarning when app is in the background
I'm noticing that my view controllers aren't getting their didReceiveMemoryWarning methods called when my application is in the background state on the iPad simulator. More specifically, I see the call to applicationDidEnterBackground in my logs,…

fieldtensor
- 3,972
- 4
- 27
- 43
7
votes
3 answers
AVCam memory low warning
This is less a question and more a record of what I've found around the AVCam sample code provided by Apple for iOS4 and 5 camera manipulation. The symptoms of the problem for me were that my app would crash on launching the AVCamViewController…

Red Nightingale
- 669
- 3
- 19
7
votes
4 answers
When is didReceiveMemoryWarning actually called
I've never personally seen didReceiveMemoryWarning called before. Is there a known threshold of memory usage where it gets called?
user1754464
7
votes
3 answers
What works in viewDidUnload should be moved to didReceiveMemoryWarning?
In new iOS 6, viewDidUnload is deprecated and we have been instructed to use didReceiveMemoryWarning instead, to manage objects in UIViewController instances and subclasses. Is it equally effective to assign nils to UIView kinds inside…

petershine
- 3,190
- 1
- 25
- 49
6
votes
2 answers
My iphone app gets memory warning and killed at 6.8MB
My app has a thread that does some time consuming job for more than a minute and the app consumes around 6.8MB of memory. I receive a memory warning after sometime and then it gets killed. There is nothing that I can release, and I am using not even…

Abix
- 260
- 2
- 16
6
votes
2 answers
How to respond to didReceiveMemoryWarning in OpenGL app
My app uses a lot of memory. Normally it runs fine, but on a loaded device that hasn't been restarted in awhile, it will be jettisoned with the infamous Low Memory error.
I would like to respond to didReceiveMemoryWarning and free up some of my…

Frank Krueger
- 69,552
- 46
- 163
- 208
5
votes
2 answers
Is didReceiveMemoryWarning / viewDidUnload called when a view controller is shown?
A question about didReceiveMemoryWarning / viewDidUnload.
If my app has many view controllers, one of them is shown, and the others back (because of I use a navigation controller or tab bar controller, it does not matter), which view controllers…

Ricardo
- 2,831
- 4
- 29
- 42
5
votes
2 answers
Why Doesn't iOS Autorotate a View loaded from a Nib after it was released by didReceiveMemoryWarning?
My iPad app makes heavy use of autorotation. This is great. However, I've noticed that if a hidden view is released by the default implementation of didReceiveMemoryWarning (as described here), when the view is re-loaded from the nib and I happen to…

theory
- 9,178
- 10
- 59
- 129
5
votes
2 answers
Huge memory consumption while parsing JSON and creating NSManagedObjects
I'm parsing a JSON file on an iPad which has about 53 MB. The parsing is working fine, I'm using Yajlparser which is a SAX parser and have set it up like this:
NSData *data = [NSData dataWithContentsOfFile:path…

gasparuff
- 2,295
- 29
- 48