1. of the code to their own preference.

1.     
Introduction:

Mobile phones becomes a basic necessity of our digital world.
First computer and now smart mobile phones revolutionize our every aspect of
life. Modern smartphones are closer to handheld computers that enable us to
send emails, play games, watch news, make video calls, and can perform banking
tasks and much more besides. Mobile operating system is a software which
controls and drive all the components of a mobile hardware A mobile operating
system (mobile OS) is an OS built exclusively for a mobile device such as a
smartphone, personal digital assistant (PDA), tablet or other embedded mobile
OS. Now a day’s most popular mobile operating systems are Android and iOS

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

1.1 Android VS iOS

Android and
iOS are the two top most leading Mobile operating system in the world. Android
is launched by Google Inc. initial release was on 23rd September
2008(9 years ago) basically designed for touch screen mobiles devices later
than also developed for Android TV, android auto and Android wear, iOS is
launched by Apple Inc. initial release of iOS was on 29th June
2007(10 years ago) for iPhone, iPad, iPod. Both Operating systems are much fast,
secure and reliable.

Now a days 99% mobile devices are powered by android and iOS
so the market is also occupied by these two of Operating Systems. According to
recent stats 85% market share is occupied by Google Android 14% by Apple IPhone
iOS and 1% by others mobile operating system. According to official Press
releases of Google and Apple which states that over 2 billion android devices
are monthly active and over one billion iOS devices active worldwide.

In this paper we are going to provide a comparison between
android and iOS at operating systems level. Such that how things are handled in
these two Operating systems

1.1 Kernel:

Both Android
and iOS are forked from existing Operating systems. Android is based on Linux
kernel LTS (long-term support) branches, written in java, C and C++. Since
android run on a modified Linux kernel it have a monolithic style of kernel. Android
is an open source mobile operating system by having an
Open Source software program, Google allow developers to alter large amounts of
the code to their own preference.

On the other
hand iOS is based on Darwin (BSD) and macOS forked from UNIX operating system.
Written in C, C++, objective-C and swift. iOS have a hybrid style of kernel
(XNU) containing features of both micro & monolithic kernels. iOS is a
closed source mobile OS apple don’t allow developers
to change anything that deals with the operating system itself

2.Process & thread Management:

Table 1:
process and thread management

 

Android

iOS

 

Android

iOS

Single thread of execution

Yes

Yes

Visible process

Yes

Yes

Separate process for app components

Yes

Yes

Background process

Yes

yes

Separate Threads for app components

Yes

Yes

Using of threads

Yes

Yes

Controlling of process

Yes

No

Inter Process communication (IPC)

Yes

Yes

Process shutdown by OS

Yes

yes

Remote Procedure calls RPC for IPC

Yes

No

foreground Process

Yes

yes

URL scheme for IPC

No

yes

Process States

Yes

Yes

Perform I/o operation

Yes

yes

 

When an
application component starts and the application does not have any other
components running, both operating systems starts a new process for the
application with a single thread of execution. In both OS By default all
components of the same application run in the same process and thread (called
the “main” thread) in android main thread is called UI thread. Each
process is made up of one or more thread which run dependently or independently
and every thread use the same virtual memory and address space of the process.
In android all components of the same application run in the same process and
most applications should not change this if to control which process a certain
component belongs to, this can be done in manifest file. If a new application need
to start and there is not enough space in the memory then both the OS android
and iOS forcefully shut down the process according to their importance to
create space for new process. There is a hierarchy of processes to determine
which process will be killed first or last while system is low on memory, in
android foreground process, visible process, service process, background
process & empty process. In iOS the hierarchy is same like this foreground
processes, background processes, suspended processes & not running
processes, the list is based on “importance hierarchy”  it mean importance of first process is high
so it will be killed at last while last one killed first. There are different
states of a process, in android states are created, running, Paused, stopped
& killed, in iOS states of process is Not running, active, inactive, background
& suspended. Android provides a proper mechanism for inter process
communication IPC through RPCs Remote procedure calls, in which a method is
called by an activity or other application component, but executed remotely (in
another process), with any result returned back to the caller. In iOS two
techniques are used for IPC which is Grand central dispatch and pasteboard. In
both Operating systems processes can perform I/O operations.

3. Memory Management

Memory
management is a very important aspect of every modern operating system. Mobile
operating systems like android and iOS handle and manage memory very
efficiently.

 

Android

iOS

Virtual memory

Yes

Yes

Page size

4kb

4-16kb

ARC

No

Yes

Garbage collector

Yes

No

Generational memory heap

Yes

No

Eden space

Yes

no

Survivor space

Yes

No

Tenured space

Yes

no

Permanent space

Yes

No

Autorealease pools

No

yes

Auto deallocation

No

Yes

Factory method

No

yes

GC of java

Runtime

ARC of mac OS X

Compile time

Memory share

Yes

No

Voluntarily free up memory

No

yes

 

3.1 Android Memory Management

Android use
memory mapping and paging to handle memory problems. Page size is of 4kb. Any
application old or new can’t be removed from memory and remain in the main memory
until that application releases the object references it holds and making the
occupied memory available for Garbage Collector (GC) to Clean. Inside a managed
memory environment like in android system keep track of its memory allocation. The
technique of reclaiming unused memory from application after determining that a
piece of memory is no longer used by any application is called garbage cleaning.
There are two goals of a GC. Finding those type of data object which are not accessed
in future and reclaiming the memory used by those data objects. Android memory
is generational type of memory. In generational memory there are three type of
generation young generation, old generation and permanent generation. The newly
created object stays in young generation. When an object lives long then that
object transfer to older generation. Young and old generation are further
divided into to Eden and survivor space generation, tenured generation. Permanent
generation is a generation where classes of java and method object resides in
it. GC of java works at runtime. In generational memory every generation has it
own upper limit that when will garbage collector start and how long it remain
active for cleaning and how many data object remain in a generation.

3.2 iOS memory management

iOS support
full time virtual memory environment. Page size is same as android 4kb but some
hardware support 16kb of page size. MAC OSX uses garbage collector of objective
C rather than iOS based on MAC OSX it don’t use GC for memory cleaning. It uses
another technique which is known as Automatic Reference counter (ARC). The main
methods of ARC are retain and release and these methods are inserted in code at
compile time. In ARC when an object is created or copy of object is created it’s
retain count become 1. When any other object shows an ownership interest in a
object its retain count increases to 2 and whenever owner releases it ownership
its retain count reduced by 1. When the retain count become zero the object is
destroyed. There is a auto release pool when an object is placed in this then
that object is release after the program execution exits beyond the scope. There
is a method auto deallocation when retain count of a object becomes zero the
deallocation method is call to reclaim the resource. iOS applications voluntarily
free up memory for another applications.

 

4. Virtual Memory

Android and
iOS both support full time virtual memory environment comparison of both OS
virtual memory is give below

 

 

Android

iOS

Virtual memory support

Yes

Yes

Memory mapping

Yes

Yes

Paging

Yes

Yes

Page size

4kb

4-16 kb

Virtual address

Yes

Yes

Physical address

Yes

Yes

Swapping

No

Yes

Logical address space

Yes

Yes

Thrashing

No

yes

Memory management unit MMU

Yes

yes

 

4.1 Android Virtual memory

Android
support virtual memory and use memory mapping and paging to implement virtual
memory. Page size is of 4 kb. Two types of addresses are generated in virtual
memory one is physical address and other is virtual address. When system is low
on memory android kill the apps according to priorities but don’t support
swapping of apps to secondary memory from main memory. In android every process
remains in its own separate logical address.

4.2 iOS virtual memory

iOS also
support virtual memory and use memory mapping and paging to implement Virtual Memory.
Page size is of 4kb but in some hardware support 16kb page size. Two type of
address are generated in this virtual memory one is physical address and other
is virtual address. When system is low on memory iOS kill the apps according to
priorities but also support swapping of apps to secondary memory from main
memory to free up memory for new apps. In iOS every process remains in its own
separate logical address.

5.
Processes and threads Scheduling

 

Android

iOS

Priority
based scheduling

Yes

yes

Normal
priority

Yes

Yes

Static
& dynamic priority

Yes

No

High
priority

Yes

Yes

Real
time priority

Yes

Yes

Kernel
thread priority

No

Yes

Completely
fair scheduler CFS

Yes

no

First
in first out FIFO

Yes

No

Round
robin

Yes

Yes

Total
priority range

0-139

0-127

Lowest
to highest priority range

0-39

0-63

System
reserved thread priority range

64-95

Real
time priority range

40-139

96-127

 

5.1
Android scheduling

Scheduling in android is done according to priorities of
process. Priorities defines that which process take how much of the Central Processing
Unit (CPU) time. The range of priorities are from 0 to 139. There are three
types of priorities, first one is static priority. This is the default and
lowest priority of newly created thread. Second one is the dynamic priority. When
processes or thread don’t get enough CPU time and they start starving because
of higher priority thread take all the CPU time then dynamic priority comes to
action. In dynamic priority, priorities of those processes and threads are raised
which are starving. It is called dynamic because priorities are keep on
changing (lower and higher) in this. Both static and dynamic priorities range
from 0 to 39. The third priority is Real Time priority in this priority all the
real time processes are scheduled under a scheduling policy. Which are Round
robin (RR) and First in first out (FIFO). Real time priority weight more than
in comparison to static and dynamic priority. Real time priority range start
from 40 to 139. In Linux 2.6.23 a new scheduling policy was introduced that is Completely
Fair Scheduler CFS. In this scheduling policy those process gets CPU which receive
least CPU so far.