Symbian App life cycle: Apps never killed?
Coming from Android/WP7 and having been involved in Symbian projects by the past, i would like now to exactly understand the Symbian App life cycle. I want to understand how the Apps are killed..
I found this:
[QUOTE] "The Symbian platform is a modern preemptive multitasking operating system. Applications are created in their own process, running in a single main thread. The kernel preemptively schedules all threads in the system, based on their priority. While it is possible to create secondary threads, Symbian strongly encourages applications to co-operatively multi-task using active objects. ".[/QUOTE]
[QUOTE] "(..) applications may be up and running at the same time and the user may switch between active applications. When a asynchronous event occurred, running application is moved to the background but it remains active".[/QUOTE]
My question is: How the system deals with the RAM issue? Is there any callback to indicate that the mobile is in low memory conditions? Any callback to indicate the App is about to be destroyed?
Does it mean that Symbian allows starting each single App, till there is not enough memory?
In UIQ framework i remember some kind of lowMemory() call-back, but one never used that..
Thanks, for your help..
Re: Symbian App life cycle: Apps never killed?
All you ever wanted to know and then some: [url]http://www.developer.nokia.com/Community/Wiki/Symbian_OS_Internals[/url]
Docs in [url]http://library.developer.nokia.com/[/url]
There's an Ouf of Memory client API (or at least used to be in S60 v5): [url]http://library.developer.nokia.com/index.jsp?topic=/S60_5th_Edition_Cpp_Developers_Library/GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6/html/OOM_Monitor_API4.html[/url]
Re: Symbian App life cycle: Apps never killed?
Yep generally, when RAM goes low, there is that monitor thingi, which starts shutting down apps which are not having focus. The shut down is done by sending teh shutdown events, so if app wants to not shut down, it would have that possibility as well, but on those cases it should be designed in a way that it would free the RAM memory, basically very similarly as it descriped to be needed with GOOM monitor.
Re: Symbian App life cycle: Apps never killed?
While this ROomMonitorSession only became part of the public SDK recently, the EEikCmdExit-part always has been true, if the OS wants to close an application for any reason, this command is issued (for example the Task Switcher uses it too).
And of course there is the simple case for the "current" application: when it can not get the memory it wants to allocate, depending on the leaving/non-leaving method used, a KErrNoMemory leave or a NULL pointer is produced. After that it is up to the application if it handles the failed allocation, or crashes.
(By the way: the GOOM thing mentioned by Jukka is yet another thing, it is about running out of dedicated GPU memory, on devices where it is available: [url]http://www.developer.nokia.com/Community/Wiki/Graphics_memory_handling[/url])