<s>
Dalvik	B-Application
is	O
a	O
discontinued	O
process	O
virtual	B-Architecture
machine	I-Architecture
(	O
VM	O
)	O
in	O
the	O
Android	B-Application
operating	I-Application
system	I-Application
that	O
executes	O
applications	O
written	O
for	O
Android	B-Application
.	O
</s>
<s>
(	O
Dalvik	B-Application
bytecode	O
format	O
is	O
still	O
used	O
as	O
a	O
distribution	O
format	O
,	O
but	O
no	O
longer	O
at	O
runtime	O
in	O
newer	O
Android	B-Application
versions	I-Application
.	O
)	O
</s>
<s>
Dalvik	B-Application
was	O
an	O
integral	O
part	O
of	O
the	O
Android	B-Application
software	I-Application
stack	O
in	O
the	O
(	O
now	O
unsupported	O
)	O
Android	B-Application
versions	I-Application
4.4	B-Application
"	I-Application
KitKat	I-Application
"	I-Application
and	O
earlier	O
,	O
which	O
were	O
commonly	O
used	O
on	O
mobile	O
devices	O
such	O
as	O
mobile	O
phones	O
and	O
tablet	B-Device
computers	I-Device
,	O
and	O
more	O
in	O
some	O
devices	O
such	O
as	O
smart	B-Device
TVs	I-Device
and	O
wearables	B-Operating_System
.	O
</s>
<s>
Dalvik	B-Application
is	O
open-source	B-Application
software	I-Application
,	O
originally	O
written	O
by	O
Dan	B-Application
Bornstein	I-Application
,	O
who	O
named	O
it	O
after	O
the	O
fishing	O
village	O
of	O
Dalvík	O
in	O
Eyjafjörður	O
,	O
Iceland	O
.	O
</s>
<s>
Programs	B-Application
for	O
Android	B-Application
are	O
commonly	O
written	O
in	O
Java	B-Language
and	O
compiled	B-Language
to	O
bytecode	O
for	O
the	O
Java	B-Language
Virtual	I-Language
Machine	I-Language
,	O
which	O
is	O
then	O
translated	O
to	O
Dalvik	B-Application
bytecode	O
and	O
stored	O
in	O
.dex	B-Application
(	O
Dalvik	B-Application
EXecutable	O
)	O
and	O
.odex	B-Application
(	O
Optimized	O
Dalvik	B-Application
EXecutable	O
)	O
files	O
;	O
related	O
terms	O
odex	B-Application
and	O
de-odex	O
are	O
associated	O
with	O
respective	O
bytecode	O
conversions	O
.	O
</s>
<s>
The	O
compact	O
Dalvik	B-Application
Executable	O
format	O
is	O
designed	O
for	O
systems	O
that	O
are	O
constrained	O
in	O
terms	O
of	O
memory	B-Architecture
and	O
processor	B-General_Concept
speed	O
.	O
</s>
<s>
The	O
successor	O
of	O
Dalvik	B-Application
is	O
Android	B-Application
Runtime	I-Application
(	O
ART	B-Application
)	O
,	O
which	O
uses	O
the	O
same	O
bytecode	O
and	O
.dex	B-Application
files	O
(	O
but	O
not	O
.odex	B-Application
files	O
)	O
,	O
with	O
the	O
succession	O
aiming	O
at	O
performance	O
improvements	O
.	O
</s>
<s>
The	O
new	O
runtime	O
environment	O
was	O
included	O
for	O
the	O
first	O
time	O
in	O
Android	B-Application
4.4	I-Application
"	O
KitKat	B-Application
"	O
as	O
a	O
technology	O
preview	O
,	O
and	O
replaced	O
Dalvik	B-Application
entirely	O
in	O
later	O
versions	O
;	O
Android	B-Application
5.0	I-Application
"	I-Application
Lollipop	I-Application
"	I-Application
is	O
the	O
first	O
version	O
in	O
which	O
ART	B-Application
is	O
the	O
only	O
included	O
runtime	O
.	O
</s>
<s>
Unlike	O
Java	B-Language
Virtual	I-Language
Machines	I-Language
,	O
which	O
are	O
stack	B-Application
machines	I-Application
,	O
the	O
Dalvik	B-Application
VM	I-Application
uses	O
a	O
register-based	B-Application
architecture	I-Application
that	O
requires	O
fewer	O
,	O
typically	O
more	O
complex	O
,	O
virtual	B-Architecture
machine	I-Architecture
instructions	O
.	O
</s>
<s>
Dalvik	B-Application
programs	B-Application
are	O
written	O
in	O
Java	B-Language
using	O
the	O
Android	B-Application
application	I-Application
programming	B-Application
interface	I-Application
(	O
API	B-Application
)	O
,	O
compiled	B-Language
to	O
Java	B-Language
bytecode	I-Language
,	O
and	O
converted	O
to	O
Dalvik	B-Application
instructions	O
as	O
necessary	O
.	O
</s>
<s>
A	O
tool	O
called	O
dx	O
is	O
used	O
to	O
convert	O
Java	B-Language
.class	B-Language
files	O
into	O
the	O
.dex	B-Application
format	O
.	O
</s>
<s>
Multiple	O
classes	O
are	O
included	O
in	O
a	O
single	O
.dex	B-Application
file	O
.	O
</s>
<s>
Duplicate	O
strings	O
and	O
other	O
constants	O
used	O
in	O
multiple	O
class	B-Language
files	I-Language
are	O
included	O
only	O
once	O
in	O
the	O
.dex	B-Application
output	O
to	O
conserve	O
space	O
.	O
</s>
<s>
Java	B-Language
bytecode	I-Language
is	O
also	O
converted	O
into	O
an	O
alternative	O
instruction	B-General_Concept
set	I-General_Concept
used	O
by	O
the	O
Dalvik	B-Application
VM	I-Application
.	O
</s>
<s>
An	O
uncompressed	B-General_Concept
.dex	B-Application
file	O
is	O
typically	O
a	O
few	O
percent	O
smaller	O
in	O
size	O
than	O
a	O
compressed	B-General_Concept
Java	B-Language
archive	I-Language
(	O
JAR	B-Language
)	O
derived	O
from	O
the	O
same	O
.class	B-Language
files	O
.	O
</s>
<s>
The	O
Dalvik	B-Application
executables	O
may	O
be	O
modified	O
again	O
when	O
installed	O
onto	O
a	O
mobile	O
device	O
.	O
</s>
<s>
In	O
order	O
to	O
gain	O
further	O
optimizations	O
,	O
byte	O
order	O
may	O
be	O
swapped	O
in	O
certain	O
data	O
,	O
simple	O
data	B-General_Concept
structures	I-General_Concept
and	O
function	B-Library
libraries	I-Library
may	O
be	O
linked	B-Application
inline	O
,	O
and	O
empty	O
class	O
objects	O
may	O
be	O
short-circuited	O
,	O
for	O
example	O
.	O
</s>
<s>
Being	O
optimized	O
for	O
low	O
memory	B-Architecture
requirements	O
,	O
Dalvik	B-Application
has	O
some	O
specific	O
characteristics	O
that	O
differentiate	O
it	O
from	O
other	O
standard	O
VMs	O
:	O
</s>
<s>
The	O
constant	O
pool	O
has	O
been	O
modified	O
to	O
use	O
only	O
32-bit	O
indices	O
to	O
simplify	O
the	O
interpreter	B-Application
.	O
</s>
<s>
Standard	O
Java	B-Language
bytecode	I-Language
executes	O
8-bit	O
stack	O
instructions	O
.	O
</s>
<s>
Dalvik	B-Application
instead	O
uses	O
its	O
own	O
16-bit	B-Device
instruction	B-General_Concept
set	I-General_Concept
that	O
works	O
directly	O
on	O
local	O
variables	O
.	O
</s>
<s>
The	O
local	O
variable	O
is	O
commonly	O
picked	O
by	O
a	O
4-bit	O
"	O
virtual	O
register	B-Application
"	O
field	O
.	O
</s>
<s>
This	O
lowers	O
Dalvik	B-Application
's	O
instruction	O
count	O
and	O
raises	O
its	O
interpreter	B-Application
speed	O
.	O
</s>
<s>
According	O
to	O
Google	O
,	O
the	O
design	O
of	O
Dalvik	B-Application
permits	O
a	O
device	O
to	O
run	O
multiple	O
instances	O
of	O
the	O
VM	O
efficiently	O
.	O
</s>
<s>
Android	B-Application
2.2	I-Application
"	I-Application
Froyo	I-Application
"	I-Application
brought	O
trace-based	O
just-in-time	O
(	O
JIT	O
)	O
compilation	B-Language
into	O
Dalvik	B-Application
,	O
optimizing	O
the	O
execution	O
of	O
applications	O
by	O
continually	O
profiling	O
applications	O
each	O
time	O
they	O
run	O
and	O
dynamically	O
compiling	B-Language
frequently	O
executed	O
short	O
segments	O
of	O
their	O
bytecode	O
into	O
native	O
machine	B-Language
code	I-Language
.	O
</s>
<s>
While	O
Dalvik	B-Application
interprets	B-Application
the	O
rest	O
of	O
application	O
's	O
bytecode	O
,	O
native	B-Language
execution	I-Language
of	O
those	O
short	O
bytecode	O
segments	O
,	O
called	O
"	O
traces	O
"	O
,	O
provides	O
significant	O
performance	O
improvements	O
.	O
</s>
<s>
The	O
relative	O
merits	O
of	O
stack	B-Application
machines	I-Application
versus	O
register-based	O
approaches	O
are	O
a	O
subject	O
of	O
ongoing	O
debate	O
.	O
</s>
<s>
Generally	O
,	O
stack-based	O
machines	O
must	O
use	O
instructions	O
to	O
load	O
data	O
on	O
the	O
stack	O
and	O
manipulate	O
that	O
data	O
,	O
and	O
,	O
thus	O
,	O
require	O
more	O
instructions	O
than	O
register	B-Application
machines	I-Application
to	O
implement	O
the	O
same	O
high-level	B-Language
code	I-Language
,	O
but	O
the	O
instructions	O
in	O
a	O
register	B-Application
machine	I-Application
must	O
encode	O
the	O
source	O
and	O
destination	O
registers	O
and	O
,	O
therefore	O
,	O
tend	O
to	O
be	O
larger	O
.	O
</s>
<s>
This	O
difference	O
is	O
of	O
importance	O
to	O
VM	O
interpreters	B-Application
,	O
for	O
which	O
opcode	B-Language
dispatch	O
tends	O
to	O
be	O
expensive	O
,	O
along	O
with	O
other	O
factors	O
similarly	O
relevant	O
to	O
just-in-time	O
compilation	B-Language
.	O
</s>
<s>
Tests	O
performed	O
on	O
ARMv7	O
devices	O
in	O
2010	O
by	O
Oracle	B-Application
(	O
owner	O
of	O
the	O
Java	B-Language
technology	I-Language
)	O
with	O
standard	O
non-graphical	O
Java	B-Language
benchmarks	O
showed	O
the	O
HotSpot	B-Language
VM	O
of	O
Java	B-Language
SE	O
embedded	O
to	O
be	O
2	O
–	O
3	O
times	O
faster	O
than	O
the	O
JIT-based	O
Dalvik	B-Application
VM	I-Application
of	O
Android	B-Application
2.2	I-Application
(	O
the	O
initial	O
Android	B-Application
release	O
that	O
included	O
a	O
JIT	O
compiler	B-Language
)	O
.	O
</s>
<s>
In	O
2012	O
,	O
academic	O
benchmarks	O
confirmed	O
the	O
factor	O
of	O
3	O
between	O
HotSpot	B-Language
and	O
Dalvik	B-Application
on	O
the	O
same	O
Android	B-Application
board	O
,	O
also	O
noting	O
that	O
Dalvik	B-Application
code	O
was	O
not	O
smaller	O
than	O
Hotspot	B-Language
.	O
</s>
<s>
Furthermore	O
,	O
,	O
benchmarks	O
performed	O
on	O
an	O
Android	B-Application
device	O
still	O
show	O
up	O
to	O
a	O
factor	O
100	O
between	O
native	B-Language
applications	I-Language
and	O
a	O
Dalvik	B-Application
application	O
on	O
the	O
same	O
Android	B-Application
device	O
.	O
</s>
<s>
Upon	O
running	O
benchmarks	O
using	O
the	O
early	O
interpreter	B-Application
of	O
2009	O
,	O
both	O
Java	B-Language
Native	I-Language
Interface	I-Language
(	O
JNI	B-Language
)	O
and	O
native	B-Language
code	I-Language
showed	O
an	O
order	O
of	O
magnitude	O
speedup	O
.	O
</s>
<s>
Dalvik	B-Application
is	O
published	O
under	O
the	O
terms	O
of	O
the	O
Apache	B-Application
License	I-Application
2.0	O
.	O
</s>
<s>
Some	O
say	O
that	O
Dalvik	B-Application
is	O
a	O
clean-room	O
implementation	O
rather	O
than	O
a	O
development	O
on	O
top	O
of	O
a	O
standard	O
Java	B-Language
runtime	I-Language
,	O
which	O
would	O
mean	O
it	O
does	O
not	O
inherit	O
copyright-based	O
license	O
restrictions	O
from	O
either	O
the	O
standard-edition	O
or	O
open-source-edition	O
Java	B-Language
runtimes	I-Language
.	O
</s>
<s>
Oracle	B-Application
and	O
some	O
reviewers	O
dispute	O
this	O
.	O
</s>
<s>
On	O
August	O
12	O
,	O
2010	O
,	O
Oracle	B-Application
,	O
which	O
acquired	O
Sun	O
Microsystems	O
in	O
April	O
2009	O
and	O
therefore	O
owns	O
the	O
rights	O
to	O
Java	B-Language
,	O
sued	O
Google	O
over	O
claimed	O
infringement	O
of	O
copyrights	O
and	O
patents	O
.	O
</s>
<s>
Oracle	B-Application
alleged	O
that	O
Google	O
,	O
in	O
developing	O
Android	B-Application
,	O
knowingly	O
,	O
directly	O
and	O
repeatedly	O
infringed	O
Oracle	B-Application
's	O
Java-related	O
intellectual	O
property	O
.	O
</s>
<s>
In	O
May	O
2012	O
,	O
the	O
jury	O
in	O
this	O
case	O
found	O
that	O
Google	O
did	O
not	O
infringe	O
on	O
Oracle	B-Application
's	O
patents	O
,	O
and	O
the	O
trial	O
judge	O
ruled	O
that	O
the	O
structure	O
of	O
the	O
Java	B-Language
APIs	B-Application
used	O
by	O
Google	O
was	O
not	O
copyrightable	O
.	O
</s>
