Low Memory Warning

Low Memory Warning

What is the Low Memory Warning

The iOS operating system sends your app a warning when its memory use approaches the limit of available device memory.

The operating system sends low-memory warnings using a best-effort approach, and your app needs to respond to them as quickly as possible.

Out of Memory crash often happens when the system increases faster than the warnings relieve memory pressure.

Make sure your app changes its approach for allocating memory when it receives a memory warning—adopting a conservative policy of looking for opportunities to release objects or reduce their size as it uses them.

 

What about NAOSDK

NAOSDK is continuously looking for ways to improve user experience, but crashes can sometimes slip through, which we understand is very frustrating.

That’s why, when The application is running out of memory, NAOSDK will stop all running services.

This information is tracked in the naoServices.naolog file.

 

CNAOServiceManager::writeToLog Memory Warning : stop service manager

 

Applications using NAOSDK must implement the OS’s callback interface for low memory warning.

 

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleMemoryWarning:) name: UIApplicationDidReceiveMemoryWarningNotification object:nil]; - (void) handleMemoryWarning:(NSNotification *)notification  { //TODO:  release objects or reduce size }

This interface can give the application the ability to safely exit the user experience.

 

Since NAOSDK 4.11.15

Ability to configure this behavior.

This is a new static interface in NAOServicesConfig that will allow you to disable this memory management behavior from NAOSDK.

Important notice

Setting this value to false means that NAOSDK will continue to work despite this warning.
If the application does nothing at that time, it is very likely that the application will crash at any time and in any module, including NAOSDK, because the memory management will be corrupted.

 

/**
 *@brief activate / deactivate  Memory warning  managment (this value is true by default)
 *@param[in]    use      true to activate
 *@return       None
 */
+ (void)handleMemoryWarning:(bool)activate;

onError notified

If services are stopped due to a Memory Warning. All NAOSDK clients receive the following error: “Memory Warning : Stop and destroy service

    • Related Articles

    • Release 24.03 (NAOSDK 4.11.15)

      Versions Component Version NAO® Cloud 24.03 NAO® Viewer 24.03 NAO® SDK iOS 4.11.15 NAO® SDK Android 4.11.15 NAO® Logger iOS 4.11.15 NAO® Logger Android 4.11.15 New Features NAO® Viewer Management of time overruns: to help our clients monitor ...
    • Release 22.06 (NAO SDK 4.11.7.8 / Hot Fix iOS 4.11.7.9)

      Versions Component Version Hotfix NAO® Cloud 22.06 NAO® SDK iOS 4.11.7.8 4.11.7.9 NAO® SDK Android 4.11.7.8 NAO® Logger iOS 4.11.7.8 NAO® Logger Android 4.11.7.8 New Features NAO® Cloud Nao track web app is now available Nao track web app crash ...
    • Release 22.09 (NAO SDK 4.11.8)

      Versions Component Version NAO® Cloud 22.09 NAO® SDK iOS 4.11.8 NAO® SDK Android 4.11.8 NAO® Logger iOS 4.11.8 NAO® Logger Android 4.11.8 New Features NAO® Cloud NAO Server, NAO Cloud self-hosted version is now available MappedIn maps compatibility ...
    • App publication

      If your application needs to use the service in background mode, you must follow a few rules to avoid a rejection of your application on AppStore. Basic rule Apple only accepts applications that use background modes when it is justified. Example use ...
    • Power usage

      SDK Services are started in high power mode by default to provide the best location accuracy. With high accuracy also comes higher battery consumption, which might be too much for application running in the background for extended periods of time ...