A Real-time Extension to the Android Platform

Similar documents
Basic Trends of Modern Software Development

A Look through the Android Stack

Android Architecture. Alexandra Harrison & Jake Saxton

Introduction to Android

Android Operating System:

Mobile Devices - An Introduction to the Android Operating Environment. Design, Architecture, and Performance Implications

Android Operating System

Programming the Android Platform. Logistics

Mobile Devices - An Introduction to the Android Operating Environment. Design, Architecture, and Performance Implications

ANDROID OPERATING SYSTEM

Introduction to Android

ANDROID BASED MOBILE APPLICATION DEVELOPMENT and its SECURITY

Mobile Phones Operating Systems

Research and Design of Universal and Open Software Development Platform for Digital Home

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

imaginea white paper

An Introduction to Android. Huang Xuguang Database Lab. Inha University

Android Programming and Security

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Analysis of advanced issues in mobile security in android operating system

ITG Software Engineering

An Introduction to Android

Android Architecture For Beginners

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

Overview of CS 282 & Android

Example of Standard API

Understand and Build Android Programming Environment. Presented by: Che-Wei Chang

Lecture 1 Introduction to Android

Lecture 17: Mobile Computing Platforms: Android. Mythili Vutukuru CS 653 Spring 2014 March 24, Monday

RoverPal - A Mobile Payment Application

Smartphone market share

CS378 -Mobile Computing. Android Overview and Android Development Environment

Review On Google Android a Mobile Platform

Performance Analysis of Android Platform

GETTING STARTED WITH ANDROID DEVELOPMENT FOR EMBEDDED SYSTEMS

Mobile Application Development Android

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Synthesis for Developing Apps on Mobile Platforms

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Overview. The Android operating system is like a cake consisting of various layers.

Android 5.0: Lollipop OS

General Introduction

The Android Platform

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Frameworks & Android. Programmeertechnieken, Tim Cocx

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Mobile Operating Systems. Week I

Application of Android OS as Real-time Control Platform**

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

A Short Introduction to Android

Creating and Using Databases for Android Applications

Publishing to TIZEN Using the Automated Conversion/Repackaging of Existing Android Apps. Hyeokgon Ryu, Infraware Technology, Ltd.

International Engineering Journal For Research & Development

Android Fundamentals 1

Berlin Institute of Technology FG Security in Telecommunications

Praktikum Entwicklung Mediensysteme (für Master)

Mobile Platform Architecture Review: Android, iphone, Qt

Android Geek Night. Application framework

What else can you do with Android? Inside Android. Chris Simmonds. Embedded Linux Conference Europe Copyright 2010, 2net Limited.

Development. SriSeshaa Technologies. Table of Contents

Issues in Android on Mobile Platform and Their Resolution

Understanding Android s Security Framework

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Android Development: Part One

Module Title: Software Development A: Mobile Application Development

Remote Desktop on Mobile

AppScope: Application Energy Metering Framework for Android Smartphones using Kernel Activity Monitoring

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

The Design of the Inferno Virtual Machine. Introduction

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Android on i.mx Applications Processors

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

COMMONLY, the problem that most any computing platform will have is interoperability, and

Android in opposition to iphone

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

OMX, Android, GStreamer How do I decide what to use? 15 July 2011

Workshop on Android and Applications Development

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. Oct 2003 Presented to Gordon College CS 311

Multi-core Programming System Overview

Realtime Java. Christoph Neijenhuis

Virtualization: Hypervisors for Embedded and Safe Systems. Hanspeter Vogel Triadem Solutions AG

Tablets in Data Acquisition

RTAI. Antonio Barbalace (modified by M.Moro 2011) RTAI

Tutorial on Basic Android Setup

A Survey on Android vs. Linux

Android Basics. Xin Yang

Android v ios Mobile Operating Systems

Deep Inside Android. OpenExpo Zurich September 25 th, Gilles Printemps - Senior Architect. Copyright 2007 Esmertec AG.

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

Android for the Enterprise and OEMs. Peter Vescuso Black Duck Software

Friendly ARM MINI2440 & Dalvik Virtual Machine with Android

Hacking your Droid ADITYA GUPTA

Deployment of Mobile Application for Multiplatform Operating Systems

Disclaimer: The contents in this document are only my personal opinions, do not reflect the opinions of my employer or anyone else.

Introduction to Android

Transcription:

JTRES 2012 A Real-time Extension to the Android Platform Igor Kalkov, Dominik Franke, John F. Schommer, Stefan Kowalewski 24-26 October 2012 Copenhagen, Denmark

Introduction Mobile platform by Open Handset Alliance - Supervised by Google - Open-sourced under Apache 2.0 license Android software stack: Applications Stock & user applications Application Framework Application framework Services & system managers Libraries Android runtime Dalvik virtual machine Linux Kernel SSL, media, SQLite database Adapted Linux kernel Hardware drivers, memory & process management Applications Runtime 2 / 15

Motivation Real-time support expands the field of application - Opening safety- & time-critical domains - In-field monitoring, controlling platform for home automation - Better core functionalities: speech or video processing Goals - Possibility of serving real-time requests - Keeping original functionality / backward compatibility Wide range of compatible hardware platforms - Smartphones, tablets, OMAP hardware Further applications: ereaders, TVs, Nanosatellites 3 / 15

Several proposed approaches: Related Work 4 / 15

Approach Applications System Applications 3rd Party Applications Extended Activity Manager Application Framework - Reliable execution of RT apps Activity Manager Notification Manager Package Manager - Bypassing OOM process killer Resource Manager Window Manager Modified Dalvik VM Libraries Android Runtime - Encapsulated priority selection - Explicit memory management Graphics SSL SQLite Core Libraries Dalvik Virtual Machine Improved Linux kernel v2.6.29 - Patched with PREEMPT_RT - Enabled priority scheduling Hardware Drivers Memory Management Linux Kernel Power Management Binder (IPC) Driver Process Management 5 / 15

Internal process importance Activity Manager - Depends on the application class (back- / foreground) - Reflected in OOM adjustment values adj p Built-in OOM process killer - Killing unimportant processes first - Memory thresholds mem t and corresponding levels adj t Example with mem 3 = 20 MB and adj 3 = 7 - Terminate processes with adj p 7 on mem free 20 MB RT processes must get lowest possible adj p values 6 / 15

Memory Management (1) Advantages: - Smart low memory process killer - Process-independent GC (Dalvik VM) Disadvantages: - Mark-and-sweep algorithm - Execution of all threads is suspended (up to 200 ms) No reliable prediction of process behavior Explicit allocation control 7 / 15

Memory Management (2) 8 / 15

Real-time priority Normal priority Programming Interface Introducing new class ServiceRT.java - Extends Android s native Service.java class - API for priority selection for own process - API for explicit memory deallocation Android OS Linux kernel instantiate set adj_p :ServiceRT change priority terminate 9 / 15

Evaluation Testing device: HTC Dream / Google G1 Background service based on ServiceRT class Test 1: Periodic execution - Compare scheduled & actual execution time - Period time t P = 1 ms to t P = 1 s - Running time T = 20 s to T = 1 h - Different process priorities - Idle system or high CPU load 10 / 15

Latency (ms) Latency (ms) Latencies (1) System state: idle t P = 5 ms T = 20 s Priorities: 120 (default) vs. 40 (real-time) Non-RT Process RT Process 25 25 20 20 15 15 10 10 5 5 0 0 5000 10000 15000 20000 0 0 5000 10000 15000 20000 Execution Time (ms) Execution Time (ms) 11 / 15

Latency (ms) Latency (ms) Latencies (2) System state: under load t P = 5 ms T = 20 s Priorities: 120 (default) vs. 40 (real-time) Non-RT Process RT Process 1000 2449 7780 10 800 8 600 6 400 4 200 2 0 0 5000 10000 15000 20000 0 0 5000 10000 15000 20000 Execution Time (ms) Execution Time (ms) 12 / 15

Avg. Freeing Time (ms) Memory Footprint (kb) Evaluation: Memory Management Test 2: Continuous data receiving - Over a 54 Mbit Wi-Fi connection - Count: 2000 packets - Size: ~ 1 kb each - Can be released after processing 3000 2900 2800 2700 2600 2500 2400 2300 2200 Automatic GC Manual Freeing 0 10 20 30 40 50 60 Time (s) Test 3: Explicit object deallocation - Allocate an object of a given size - Free it immediately - Measure the elapsed time - Calculate average of 10 cycles - For different sizes: 1 Byte to 8 MB 120 80 40 0 Automatic GC Manual Freeing 0 2000 4000 6000 8000 Object Size (kb) 13 / 15

New approach Conclusion - Patched Linux kernel & Android components - Handling of OOM adjustment values - Use Linux real-time priorities for Android applications - Explicit memory management Evaluation - Avoiding undesired invocations of the GC - Scheduling latency < 2 ms for real-time processes BUT: explicit memory management is not enough - Dangling pointers, background allocations 14 / 15

Future Work Automatic, non-blocking real-time GC algorithms - M. Schoeberl, W. Puffitsch Nonblocking Real-Time Garbage Collection - Y. Levanoni, E. Petrank On-The-Fly Reference-Counting Garbage Collector for Java Using RT-Linux high resolution timer for periodic tasks - Better scheduling latencies (WC 500 us) More about the project will be available soon under https://git.embedded.rwth-aachen.de/rtandroid 15 / 15

Thank you for your attention! Questions / Comments?