---
title: "applicationDidReceiveMemoryWarning(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiapplicationdelegate/applicationdidreceivememorywarning(_:)"
---

# applicationDidReceiveMemoryWarning(_:)

Tells the delegate when the app receives a memory warning from the system.

## Declaration

```swift
optional func applicationDidReceiveMemoryWarning(_ application: UIApplication)
```

## Parameters

- `application`: Your singleton app object.

## Mentioned in

Responding to memory warnings

## Discussion

Discussion Your implementation of this method should free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. You use this method in conjunction with the didReceiveMemoryWarning() of the UIViewController class and the didReceiveMemoryWarningNotification notification to release memory throughout your app. It is strongly recommended that you implement this method. If your app does not release enough memory during low-memory conditions, the system may terminate it outright.

## See Also

### Related Documentation

- [didReceiveMemoryWarning()](uikit/uiviewcontroller/didreceivememorywarning().md)

### Responding to environment changes

- [applicationProtectedDataDidBecomeAvailable(_:)](uikit/uiapplicationdelegate/applicationprotecteddatadidbecomeavailable(_:).md)
- [applicationProtectedDataWillBecomeUnavailable(_:)](uikit/uiapplicationdelegate/applicationprotecteddatawillbecomeunavailable(_:).md)
- [applicationSignificantTimeChange(_:)](uikit/uiapplicationdelegate/applicationsignificanttimechange(_:).md)
- [protectedDataDidBecomeAvailableNotification](uikit/uiapplication/protecteddatadidbecomeavailablenotification.md)
- [protectedDataWillBecomeUnavailableNotification](uikit/uiapplication/protecteddatawillbecomeunavailablenotification.md)
- [didReceiveMemoryWarningNotification](uikit/uiapplication/didreceivememorywarningnotification.md)
- [significantTimeChangeNotification](uikit/uiapplication/significanttimechangenotification.md)
