Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright  2003 Symbian Ltd. Andrew Thoelke Chief Technology Architect, Symbian Ltd Memory Management for Smartphones Old hat.

Similar presentations


Presentation on theme: "Copyright  2003 Symbian Ltd. Andrew Thoelke Chief Technology Architect, Symbian Ltd Memory Management for Smartphones Old hat."— Presentation transcript:

1 Copyright  2003 Symbian Ltd. Andrew Thoelke Chief Technology Architect, Symbian Ltd andrew.thoelke@symbian.com Memory Management for Smartphones Old hat or New challenge? 2nd December 2003 MM-NET Workshop on Memory Management for Handheld Devices

2 Copyright  2003 Symbian Ltd. Back to basics: What is MM about? Optimal balance of … hardware price (BOM cost) … performance (User experience) … programmer convenience (Time to market) bearing in mind stakeholders … end-users … manufacturer … device creation developers … after-market software developers in a given context … the specific context makes a big difference

3 Copyright  2003 Symbian Ltd. Some interesting contexts Timesharing systems Transaction processing systems Switching equipment Personal workstations Embedded controllers Mobile phones PDAs Open mobile phones Artificial intelligence Note: the programming language divide … access by pointer, direct memory management … access by reference, garbage collection

4 Copyright  2003 Symbian Ltd. Symbian OS evolution Origins in the Psion Series 5 PDAs Progressively ‘phonified’ over the past 5 years … Ericsson R380 Nokia 9210 FOMA 2051 Nokia 7650 Sony-Ericsson P800 … The context has changed … no longer a PDA or a simple mobile phone

5 Copyright  2003 Symbian Ltd. Two Tiers of memory management Process isolation with an MMU … guards against accidents useful given overall system complexity useful given unbounded programmer community … guards against malice vital for policing application capabilities Gives rise to two levels of MM … ‘local’ or ‘application’ memory management within a single address space, e.g. application free store, JVM memory pool … ‘global’ or ‘system’ memory management division between and management of available memory between running applications

6 Copyright  2003 Symbian Ltd. History lesson Psion PDA MMU: Process isolation ‘Open for C++’ device Technical User Traditional phone Single address space ‘Closed’ device Mass market Smartphone Process isolation ‘Open for C++’ device Semi-technical User Java becoming standard for ‘feature’ phones Traditional phone Single address space ‘Open for Java’ device Mass market Manufacturers want to use Symbian OS in mid-range products Smartphone Process isolation ‘Open for C++’ device Mass market Memory Management Application efficient heap implementation proprietary exception mechanism System single instance of application task list managed by User Memory Management Application efficient heap implementation proprietary exception mechanism System single instance of application task list managed by User Memory Management Application static memory allocation System static RAM capacity planning Memory Management Application static memory allocation System static RAM capacity planning Memory Management Application efficient heap implementation proprietary exception mechanism Java state-of-the-art garbage collection System single foreground application task manager closes background apps Memory Management Application efficient heap implementation proprietary exception mechanism Java state-of-the-art garbage collection System single foreground application task manager closes background apps

7 Copyright  2003 Symbian Ltd. Opportunities Psion PDA MMU: Process isolation ‘Open for C++’ device Technical User Traditional phone Single address space ‘Open for Java’ device Mass market Smartphone Process isolation ‘Open for C++’ device Mass market Memory Management Application efficient heap implementation proprietary exception mechanism Java state-of-the-art garbage collection System single foreground application task manager closes background apps Memory Management Application efficient heap implementation proprietary exception mechanism Java state-of-the-art garbage collection System single foreground application task manager closes background apps Current allocator is good for general purpose use: memory efficient and ‘fast’, but not real time. Exception mechanism pre- dates ISO C++, is it time to follow the standard? Good enough for now - but do we need something better for mass-market devices. Or something completely different?

8 Copyright  2003 Symbian Ltd. Where we are today In our context, … a single application is visible at any one time … background applications save their data … phones are made by a large community … phones are open to apps from anywhere … native environment is [pre-ISO] C++ ‘Pigeon hole’ us by comparison with: … ISO C++: replace exception handling … Palm PDA: add process isolation … trad. phone: unbounded developer community … desktop: bounded high-performance application load; no cheap backing store

9 Copyright  2003 Symbian Ltd. Application free store allocation Your basic Address-ordered First-fit Free-list allocator … uses single extendable linear address space … thread safe … very good for general purpose use Mostly fast (optimised assembler) Mostly memory efficient But behaves badly in certain scenarios Real-time applications may need to do better … the newest versions of the OS allow applications to define their own allocator object

10 Copyright  2003 Symbian Ltd. Exception handling Pre-dates standard C++! Essence of the mechanism: … TRAP, User::Leave() and CleanupStack … naming conventions: T/C/R types, L functions Very easy to work with! Implemented in terms of home-grown ‘long jump’ … we believe we could re-implement in terms of C++ exceptions without source incompatibility … this would have certain advantages

11 Copyright  2003 Symbian Ltd. Global memory management System memory manager evolution … Series 5 single instance of each application, running task list … Nokia 9210 shuts down apps in background when out of memory … Series 60 and UIQ: similar Series 60 has ‘hidden’ task list, app is where you left it UIQ has no task list, cannot ‘go back’ to previous task Partial-refresh SDRAM adds a new twist … unused banks of RAM can be switched off … need to defragment physical memory … and actively reduce RAM requirements when idle

12 Copyright  2003 Symbian Ltd. Taking stock Programmers must co-operate with system memory manager Works well for applications with bounded data size Problematic for some applications … e.g. web browsing, java But these could be addressed by special techniques Improving the ‘application discard’ strategy … interesting parallels with ‘local’ GC theory … can we tell when an application is ‘unused’ how much does it cost (time, energy and money) to restart application and recover the cached data Or a complete alternative...

13 Copyright  2003 Symbian Ltd. Virtual memory in Symbian OS? Definitions … process isolation: MMU+different address spaces … virtual memory: working sets, backing store etc Virtual memory is justified if … backing store is much cheaper than main store if not, then just add more main store … an unbounded number of applications have dormant unsaved data if not, then little to be gained from paging it out neither of these criteria applies on phones! … and it doesn’t look as though either will, soon

14 Copyright  2003 Symbian Ltd. Fork in the road? Do virtual memory … we become suitable for infinitely programmable devices … but the cost is high … and that market may not even be relevant for us Don’t do virtual memory … we shut out a certain market from the OS … we are however able to deliver many more features to the market we do address because we aren’t wasting resource on virtual memory!! … we should optimize the system storage manager, and make programmer model better known

15 Copyright  2003 Symbian Ltd.


Download ppt "Copyright  2003 Symbian Ltd. Andrew Thoelke Chief Technology Architect, Symbian Ltd Memory Management for Smartphones Old hat."

Similar presentations


Ads by Google