0% found this document useful (0 votes)
20 views4 pages

Real-Time Performance of Android OS

The document analyzes the reliability of the Android operating system for real-time embedded applications. It discusses Android's architecture and components. Experiments were conducted on a Texas Instruments OMAP platform to measure latency and variation when handling interrupts under different load conditions. Preliminary results show the latency introduced by the Linux kernel and Dalvik VM, as well as how load impacts timing predictability, which are important factors for real-time reliability.

Uploaded by

matadorishe
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

Real-Time Performance of Android OS

The document analyzes the reliability of the Android operating system for real-time embedded applications. It discusses Android's architecture and components. Experiments were conducted on a Texas Instruments OMAP platform to measure latency and variation when handling interrupts under different load conditions. Preliminary results show the latency introduced by the Linux kernel and Dalvik VM, as well as how load impacts timing predictability, which are important factors for real-time reliability.

Uploaded by

matadorishe
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Reliable Real-Time Applications on Android OS

Bhupinder S. Mongia Vijay K. Madisetti, Fellow, IEEE


Electrical and Computer Engineering Electrical and Computer Engineering
Georgia Tech Georgia Tech
Atlanta, GA 30332 Atlanta, GA 30332
[Link]@[Link] vkm@[Link]

Abstract – The Android operating system (OS) is widely used Dalvik VM makes full use of Linux for memory management
within several types of embedded & mobile platforms, including and multi-threading, which is intrinsic in the Java language.
mobile phones and tablets, and the industry is exploring the The Application Framework provides many higher-level
ability of Android within other embedded platforms, i.e., services to applications in the form of Java classes. This will
automotive or military, that require real-time guarantees and the
ability to meet deadlines as a pre-requisite for reliable operation.
vary in its facilities from one implementation to another.
In this paper, we present preliminary conclusions on Android’s
real-time behavior based on experimental measurements
performed on a commercially available Android platform.

Index Terms – Android OS, Realtime Software, OMAP

I. INTRODUCTION
Traditional studies on the reliability of software focus on
functional failures, and do not emphasize the time-related
behavior of systems that can also cause the software to fail.
The ability to meet deadlines and time constraints is critical to
embedded systems software (as in automotive or robotic
applications) that mandate response to stimuli within pre-
specified real-time design specifications, and reliability Fig. 1: Android OS Software Architecture [4]
considerations require a detailed evaluation of the ability of
the system to meet these specifications [1-3]. The Android OS B. Android OS in Real-Time Embedded Applications
is an operating system primarily designed for mobile
platforms by Google. It is an open source OS based on We use the automotive application as an example of the type
LINUX kernel (version 2.6) that enables developers to write of reliable embedded software applications that are being
applications primarily in Java with support for C/C++ as well investigated in the context of the use of Android. In the
[4]. Android is finding widespread acceptance in the mobile typical automotive application, there are different services
and portable computing market, and this study examines, for (Control Class: drive control, braking; Safety Class:
the first time, its performance & reliability in more demanding seatbelts, airbags; Infotainment Class: multimedia, climate
embedded real-time applications. control, communication services, etc.), that usually provide
their own user interfaces. This might overwhelm and distract
A. Android Architecture the typical driver restricting the user from exploiting the full
An Android system is a stack of software components. At capabilities of these devices. With all these features bundled
the bottom of the stack is Linux (kernel version 2.6). This together on a single platform, the unpredictability in response
provides basic system functionality like process and memory time of these simultaneously executing and interacting
management and security. Also, the kernel handles all the applications may cause the software to fail, resulting in
things such as network interface and a vast array of device unreliable operation. For instance, if the driver were using his
drivers, which make it easy to interface to peripheral GPS navigation while driving, and a higher priority phone call
hardware. On top of Linux is a set of libraries, including is received causing the GPS application to be de-scheduled for
bionic (the Google libc), media support for audio and video, a long time, the GPS application might miss out on updating
graphics (OpenGL ES), support for browsers (Webkit), and a the driver on some turn that he should have taken, or if the
lightweight database, SQLite [4]. time to respond to a phone call were too long, the call would
be missed. Additional safety considerations come into play if
A key component of an Android system is the runtime the navigation system or the braking systems were also
engine – the Dalvik Virtual Machine (VM). It was designed controlled by the Android OS, in the near future.
specifically for Android and is optimized in two ways. It is
designed to be instantiated multiple times – each application C. Experimental Setup
has its own private copy running in a Linux process. The
We have chosen Texas Instruments' “Zoom II Mobile slippage values onto a file which was read back for later
Development Kit”, featuring TI's OMAP 3430 processor as analysis.
the experimental platform [5]. The OMAP 3430 has an ARM
core, which is the most popular core for low power, hand-held The Loading application’s task was to exercise the CPU and
general purpose micro-controllers. other I/O resources on the system so that measurements could
be taken under varying loads.

The Loading application schedules another TimerTask with a


varying timer interval (10 ms for normal load and 1 ms for
heavy load). In the timer event handler function, various
dummy floating points operations are performed, some
System APIs are called (for reading the time values),
simulating an Android system under load, and the some values
Texas Instruments’ OMAP Zoom II Platform are written back onto a file thereby exercising all aspects of
the system.
The source code for Android including its kernel can be
obtained from a repository available at: The Test application uses Java’s High Precision Timer APIs
- git://[Link]/platform/[Link] to read in the current time, which gives the timer accuracy in
A detailed guide on how to build and install Android on nano seconds. The test application itself may be scheduled at
Zoom's OMAP platforms is available at 100ms or 1ms intervals.
[Link]
The Test application was tested in three scenarios: (1) Test
D. Experiment and the Test Procedure application alone, or “no load” (2) Test application with
Loading application with 10ms timer scheduler interval
The real-time responsiveness or latency measurement on simulating “normal load” (3) Test application with Loading
Android is broken down in two parts. The first part is the application with 1ms timer scheduler interval, simulating
latency introduced in handling of an interrupt within the “heavy load”. The Test application itself was run with a)100
Linux kernel i.e., the time it takes for the linux kernel, after ms timer interval, and, b)1 ms timer interval.
receiving an interrupt (timer interrupt in our experiment), to
propagate this event to the event management layer in the II. EXPERIMENTAL RESULTS
kernel. The second part is the latency introduced by Dalvik
VM, i.e., the time difference between when it receives the In all the observations (plots) shown below, the X-axis shows
event from the kernel event management layer and passes it the reading number (timer event number) and Y-axis shows
up to the Application running on top of the VM. the corresponding slippage in nanoseconds (ns).
Another factor that has to be taken into account for deciding A. Experiments with a 100 ms Test Application Timer
whether the system is reliable for real-time use, in addition to
the latency incurred in handling of external events, is the In the experiments with the 100ms timer, the Test
“variation” in this latency i.e., for a system to be deemed application was executed under no load, normal load and
reliable for real-time application, there has to be an upper heavy load conditions. For the plots presented here, the x-axis
bound on how much variation in the latency can be tolerated represents the timer event number, while the y-axis, in units of
by the real-time application. We have analysed our ns, represents the error or “slippage”. A larger slippage
experimental measurements with these criteria in mind. indicates a larger latency in responding to an interrupt, so a
real-time application would be deemed less reliable in meeting
Instrumentation of Android System: its deadlines.
This experiment involves system level latency measurements 1. Behavior under No Load : The Test application was run
i.e., the delays introduced by the Linux kernel and the Dalvik alone on the Zoom II platform and the timer latency
virtual machine combined, in propagating the event (timer) up
to the Java application running on top of Android. To achieve observations were plotted from the readings recorded by
this purpose, two separate applications, Test and Loading, the application as shown below.
were developed on the Android Zoom II MDK. The Test
application’s task was to schedule a TimerTask which would
run after the expiry of fixed timer interval (i.e., 10ms or 1ms
in this experiment) and observe the error (slippage in
deadline) by noting the time difference between when the task
was scheduled from the Java application, and when the actual
timer events were received. The application stores this
S 9000000 Slip…
15000000
4000000
5000000 ‐1000000

112
223
334
445
556
667
778
889
1
‐5000000

126
251
376
501
626
751
876
1 Fig. 4: Test application under Heavy Load
Fig. 2: Test Application under No Load.
As it can be seen from the plot, there is a small but constant
In the no load condition, the OS background task tries to slippage of deadline in invocation of the application level
program the system in Low Power Mode to conserve timer event handler. Most of the error is contained within 1ms
energy, therefore, when an interrupt occurs, the entire of the actual event time. This again can be attributed to the
system has to come back up and manage that event. fact that system does not go into sleep mode. Furthermore, th
Although there are some instances of higher delays (60 – high contention for system resources because of the Loading
100 ms), much of the error is below 10 ms range. task running with a 1ms timed schedule in which it exercises
the system for CPU and I/O usage, task scheduler has to de-
2. Behavior under Normal Load: The Test application was schedule the currently running task almost every time to
run along with the Loading application with 10ms timer invoke the Test application’s timer event handler, there is
scheduled period on Zoom II platform and the timer almost always a small but persistent slippage in the actual
latency observations were plotted from the readings time at which the handler is invoked.
recorded by the application as shown.
B. Experiments with a 1 ms Test Application Timer

20000000 The same experiment was repeated with the Test application
S event generation being programmed to occur after every 1 ms.
10000000 Also, the application was modified to store all the
observations in a buffer and write the entire buffer onto a file
0 after the experiment was finished. This was done so that
application's “file write” might not block it from receiving the
101
201
301
401
501
601
701
801
901
1

timer event in time, as that would amount to application's


‐10000000 incapability to receive the event at the right time rather than
Fig. 3: Test Application under Normal Load. delay being caused by the OS in propagating the event to the
application.
Under normal system load, the system behaves ideally for
hosting real time applications, as it may be seen from the 1. Behavior under No Load : The Test application was run
plot that there are very few occurrences of deadline
alone on the Zoom II Android Platform and the timer
slippage, and most of them are contained within nearly
5ms interval. The reason for that could be attributed to the latency observations were plotted from the readings
fact that; (i) System does not go into sleep mode as there recorded by the application as shown below.
are processes using the system resources for carrying out
certain tasks and keeping the system up; and (ii) The 200000000 Slip…
system resources are not under severe contention, where
one process using a resource may block up another 100000000
process or cause an event to be noticed after a delay.
Most of the slippage errors here are contained within the 0
5ms window, except for some very rare cases of high
1
144
287
430
573
716
859

error, e.g., higher than 100ms, implying that the events ‐1E+08
might have been dropped altogether, leading to failures.
Fig. 5 – Test Application under Light Load, showing slippage
3. Behavior under Heavy Load: The Test application was propagation and accumulation
run along with the Loading application with 1ms timer
scheduled period to exert a heavy processing and I/O load As it can be seen here, the deadline miss in this case is around
35ms for the cases when there is considerable deadline miss. It
on the system and the timer latency observations were is also evident from the graph that the deadline slippage
plotted from the readings recorded by the application as becomes more apparent during the later stages of the
shown. experiment as the previous delays keep accumulating, i.e, for
every event that is received after some delay, the events after We are now in a postion to make an analysis of the
that also show up that delay and add to it – we call this experimental behavior of Android under varying scenarios
slippage propagation and accumulation. (deadlines, load) as described in Section II.
A. Frequency of slippages increase with increasing load
2. Behavior under Normal Load: The Test application was
In all cases, increasing the load caused the frequency of
run along with the Loading application with 10ms timer slippage to increase. For instance, in Fig. 3, the slippage times
scheduled interval and the timer latency observations occurred less frequently than in Fig. 4 (under Heavy Load).
were plotted from the readings recorded by the
application as shown. B. Increasing frequency of interrupts increased slippage
times
200000000 Slipp As shown in Fig. 4 & 7, when interrupts are infrequent (Fig.
4), the slippage times were small (i.e., 1ms). However, when
100000000 the frequency of interrupts was increased, as in Fig. 7, the
slippage times increased to around 80ms.
0
C. Increasing frequency of interrupts causes slippage
112
223
334
445
556
667
778
889
1

‐1E+08 accumulation
As noticed in Fig. 6 & 7, a frequent interrupt caused Android
Fig. 6 – Application under Normal Load, with increasing
keep accumulating missed deadlines, and fall further back,
slippage accumulation.
with more frequent misses in meeting deadlines, which is
exacerbated by a heavy load.
The above plot is consistent with the plot obtained for
latency under no load except for the fact that deadline
IV. CONCLUSION
slippage in this case is almost always over 42 ms for the
cases where there is a considerable deadline miss.
Our experimental results and analyses show that deadline
misses of between 1 and 5 ms are common when the
3. Behavior under Heavy Load: The Test application was
frequency of interrupts is small (e.g., 10Hz). However, when
run along with the Loading application with 1ms timer the frequency of interrupts is increased (e.g., 1Khz), deadline
scheduled period to exert a heavy processing and I/O load misses or response times in the order of 0.5sec are observable.
on the system and the timer latency observations were Furthermore, the frequency of these misses increases with
plotted from the readings recorded by the application as time through the process of slippage accumulation, resulting in
shown. potentially a slowdown in the operation of the system. If there
are more than a dozen interrupts per second under load, we
observe that the Android OS may not demonstrate reliable
150000000 S behavior (e.g., response times increase significantly) with
100000000 respect to real-time constraints. The addition of a real-time
scheduler (e.g., a Rate Monotonic Scheduler) may increase the
50000000 reliability of Android, and we are experimenting further along
0 these lines of research.
1
126
251
376
501
626
751
876

‐50000000 While Android OS supports pre-emption and multi-tasking,


our results indicate that designers of real-time applications that
Fig. 7 – Application under Heavy Load – Increasing Slippage propose to use Android OS should conduct measurements of
and Slippage Accumulation. its behavior carefully to gauge the combined effects of
slippage, its frequency and value, and its accumulation, on the
Consistent with our analysis, when the test application itself is reliability of their system.
putting a heavy load on the system, i.e., it is very demanding
in terms of invocation of frequently occuring events, much of REFERENCES
the CPU time is spend in scheduling the test application and [1] M. R. Lyu, Handbook of Software Reliability Engineering, McGraw Hill
hence, if there is some other process, which is also heavily Publishing, 1995, ISBN 0-07-039400-8.
loading the system resources running in parallel with the test [2] J. Musa, “Operational Profiles in Software-Reliability Engineering, IEEE
Software, March 1993.
application, the system is not able cope with the high [3] G. Vo et al, “Building Automotive Software Component with the
frequency of schduling required by the test application. AutoSAR Environment – A Case Study,” Proc. 9th International
Conference on Quality Software, Jeju, Korea, Aug 24-Aug 25, 2009.
III. ANALYSIS OF EXPERIMENTS [4] Google Android SDK, [Link]
[5] Texas Instruments’ OMAP Zoom II: [Link]

Common questions

Powered by AI

To improve real-time response and reliability in Android OS for embedded systems, several strategies could be employed. Enhancing the priority scheduling and resource allocation mechanisms in the kernel to better prioritize real-time tasks can reduce delays. Modifying the Dalvik VM for optimized event propagation or using a more real-time capable virtual machine could improve response times . Introducing real-time patches to the Linux kernel or using a real-time capable kernel variant might further enhance performance. Streamlining interactions among applications and minimizing context switches can also contribute to reducing latency variations, which is crucial in automotive applications where second-level decision making is vital .

Latency and its variation are critical in evaluating the reliability of real-time applications using Android OS. A reliable system must have upper bounds on latency variations to ensure timely responses. High latency or variation can cause real-time applications to miss deadlines, leading to failures such as missed GPS guidance or delays in critical safety system responses in automotive applications . The experiments demonstrated that latency variation increases slippage, particularly under heavy load conditions, indicating potential reliability issues for real-time use if not managed properly . Failure to maintain consistent timing can lead to serious safety and performance implications in real-time embedded systems.

The experimental findings imply that careful design considerations must be prioritized in deploying Android-based real-time systems. System architects need to account for the observed latencies and slippages, especially under normal and heavy load conditions, which could impact the ability to meet real-time deadlines . Future applications should incorporate strategies like optimizing the Linux kernel or Dalvik VM to reduce latency and manage timing variations. Increasing awareness of high-load scenarios where critical systems can encounter reliability issues will be crucial, demanding adaptive load management and prioritization techniques to enhance real-time performance and reliability in the deployment of Android on diverse real-time platforms like automotive systems .

The main challenges in using Android OS for real-time embedded applications include handling system load and managing resource contention. Under high system loads, where multiple applications demand CPU and I/O resources, the task scheduler frequently de-schedules lower-priority tasks, introducing latency and deadline slippage . This becomes critical in real-time applications like automotive systems, where timely task execution is crucial. The contention for resources and the impact of multiple tasks running simultaneously can degrade performance. Ensuring timely execution amidst fluctuating load conditions requires careful balancing of load management strategies to avoid overloading system resources and ensuring priority tasks are not delayed .

The experimental setup involved using Texas Instruments' Zoom II Mobile Development Kit with an OMAP 3430 processor . The key components of the methodology included measuring latency introduced by the Linux kernel in propagating timer interrupts to the event management layer and the latency by the Dalvik VM in further passing events up to applications . The Test application scheduled tasks to measure the slippage between scheduled and actual event receipt times under different load conditions—no load, normal load, and heavy load . The results showed that under no load, there were occasional high slippages (up to 100 ms), but normal load conditions showed fewer deadline slippages, mostly contained within 5 ms. Heavy loads resulted in consistent small slippages .

The Android system architecture facilitates real-time embedded applications by providing a structured and modular framework based on the Linux kernel, supporting process isolation, memory management, and security through its driver and network interfaces . However, it also presents hindrances like the Dalvik VM, which introduces additional layers of event handling, adding to latency, and potentially impacting real-time responsiveness. Furthermore, the system's openness and extensive libraries can lead to resource contention, complicating real-time guarantee implementations when multiple applications concurrently demand high CPU and I/O resources, challenging timely task execution .

Slippage accumulation in Android OS affects long-running tasks by introducing increasing time deviations from expected task execution times, especially under varying load conditions. As observed in the experiments, slippage propagates over time, particularly noticeable in tasks programmed with frequent timer events under heavy loads, leading to compounded delays as prior delays affect subsequent event timings . Under no load, this accumulation effect is modest but becomes significant under normal and heavy loads, potentially resulting in cascading deadline misses as deviations mount over time, impacting the reliability of real-time operations .

Under heavy load conditions, Android OS experiences a small but consistent slippage in deadlines, affecting the performance of real-time applications. The heavy processing and I/O load require the task scheduler to frequently de-schedule the currently running task to invoke the application-level timer event handler, leading to constant but minor delays in event handling . The slippage is generally contained within a 1 ms deviation from actual event time, but such persistent delays can accumulate and affect time-sensitive applications if not managed effectively .

Real-time constraints significantly affect the reliability of embedded applications using Android OS in automotive applications. The need for timely response is crucial in automotive control systems such as driving and braking. In scenarios where applications like GPS navigation are de-scheduled due to higher priority tasks such as incoming calls, the reliability is compromised, risking failure in timely updates or responses, which can have safety implications . The concurrent operation and interaction of multiple applications on a single platform introduce unpredictability in response times, making the observance of strict deadlines critical for maintaining reliability .

The Android OS architecture consists of several key components. At the base, it uses the Linux kernel (version 2.6), which provides fundamental system functionalities such as process and memory management, security, network interface handling, and device drivers . On top of the kernel, there are libraries that support media (audio and video), graphics (OpenGL ES), web browsers (Webkit), and a database (SQLite). A crucial component is the Dalvik Virtual Machine, specifically optimized for Android, allowing each application to run in its own process with its own instance of the VM . Additionally, the Application Framework provides higher-level services to applications through Java classes , enabling robust functionality in embedded systems.

You might also like