<s>
zram	B-Application
,	O
formerly	O
called	O
compcache	B-Application
,	O
is	O
a	O
Linux	B-Application
kernel	I-Application
module	I-Application
for	O
creating	O
a	O
compressed	O
block	O
device	O
in	O
RAM	O
,	O
i.e.	O
</s>
<s>
a	O
RAM	B-Application
disk	I-Application
with	O
on-the-fly	O
disk	O
compression	O
.	O
</s>
<s>
The	O
block	O
device	O
created	O
with	O
zram	B-Application
can	O
then	O
be	O
used	O
for	O
swap	B-Architecture
or	O
as	O
general-purpose	O
RAM	B-Application
disk	I-Application
.	O
</s>
<s>
The	O
two	O
most	O
common	O
uses	O
for	O
zram	B-Application
are	O
for	O
the	O
storage	O
of	O
temporary	O
files	O
(	O
)	O
and	O
as	O
a	O
swap	B-Architecture
device	O
.	O
</s>
<s>
Initially	O
,	O
zram	B-Application
had	O
only	O
the	O
latter	O
function	O
,	O
hence	O
the	O
original	O
name	O
"	O
compcache	B-Application
"	O
(	O
"	O
compressed	O
cache	O
"	O
)	O
.	O
</s>
<s>
After	O
four	O
years	O
in	O
the	O
Linux	B-Application
kernel	O
's	O
driver	O
staging	O
area	O
,	O
zram	B-Application
was	O
introduced	O
into	O
the	O
mainline	O
Linux	B-Application
kernel	O
in	O
version	O
3.14	O
,	O
released	O
on	O
March	O
30	O
,	O
2014	O
.	O
</s>
<s>
From	O
Linux	B-Application
kernel	O
version	O
3.15	O
onwards	O
(	O
released	O
on	O
June	O
8	O
,	O
2014	O
)	O
,	O
zram	B-Application
supports	O
multiple	O
compression	O
streams	O
and	O
multiple	O
compression	B-General_Concept
algorithms	I-General_Concept
.	O
</s>
<s>
Compression	B-General_Concept
algorithms	I-General_Concept
include	O
DEFLATE	B-Algorithm
(	O
DEFLATE	B-Algorithm
)	O
,	O
LZ4	B-Language
(	O
LZ4	B-Language
,	O
and	O
LZ4HC	O
"	O
high	O
compression	O
"	O
)	O
,	O
LZO	B-Language
(	O
LZO-RLE	B-Language
"	O
run-length	O
encoding	O
"	O
)	O
,	O
Zstandard	B-Language
(	O
ZSTD	B-Language
)	O
,	O
842	B-Algorithm
(	O
842	B-Algorithm
)	O
.	O
</s>
<s>
From	O
kernel	O
5.1	O
,	O
the	O
default	O
is	O
LZO-RLE	B-Language
,	O
which	O
has	O
a	O
balance	O
of	O
speed	O
and	O
compression	O
ratio	O
.	O
</s>
<s>
Like	O
most	O
other	O
system	O
parameters	O
,	O
the	O
compression	B-General_Concept
algorithm	I-General_Concept
can	O
be	O
selected	O
via	O
sysfs	B-Application
.	O
</s>
<s>
When	O
used	O
as	O
a	O
compressed	O
swap	B-Architecture
space	O
,	O
zram	B-Application
is	O
similar	O
to	O
zswap	B-Application
,	O
which	O
is	O
not	O
a	O
general-purpose	O
RAM	B-Application
disk	I-Application
,	O
but	O
rather	O
an	O
in-kernel	O
compressed	O
cache	O
for	O
swap	B-Architecture
pages	O
.	O
</s>
<s>
Until	O
the	O
introduction	O
of	O
CONFIG_ZRAM_WRITEBACK	O
in	O
kernel	O
version	O
4.14	O
,	O
unlike	O
zswap	B-Application
,	O
zram	B-Application
was	O
unable	O
to	O
use	O
a	O
storage	O
device	O
as	O
a	O
backing	O
store	O
,	O
so	O
it	O
was	O
unable	O
to	O
move	O
less-frequently	O
used	O
pages	O
to	O
disk	O
.	O
</s>
<s>
However	O
,	O
zswap	B-Application
always	O
requires	O
a	O
backing	O
store	O
,	O
which	O
is	O
not	O
the	O
case	O
for	O
zram	B-Application
.	O
</s>
<s>
When	O
used	O
for	O
swap	B-Architecture
,	O
zram	B-Application
(	O
like	O
zswap	B-Application
)	O
allows	O
Linux	B-Application
to	O
make	O
more	O
efficient	O
use	O
of	O
RAM	O
,	O
since	O
the	O
operating	O
system	O
can	O
then	O
hold	O
more	O
pages	O
of	O
memory	O
in	O
the	O
compressed	O
swap	B-Architecture
than	O
if	O
the	O
same	O
amount	O
of	O
RAM	O
had	O
been	O
used	O
as	O
application	O
memory	O
or	O
disk	O
cache	O
.	O
</s>
<s>
In	O
2012	O
,	O
Ubuntu	B-Operating_System
briefly	O
considered	O
enabling	O
zram	B-Application
by	O
default	O
on	O
computers	O
with	O
small	O
amounts	O
of	O
installed	O
RAM	O
.	O
</s>
<s>
For	O
this	O
same	O
reason	O
,	O
Fedora	O
enabled	O
zram	B-Application
by	O
default	O
starting	O
with	O
release	O
33	O
.	O
</s>
<s>
Using	O
compressed	O
swap	B-Architecture
space	O
with	O
zram	B-Application
or	O
zswap	B-Application
also	O
offers	O
advantages	O
for	O
low-end	O
hardware	O
devices	O
such	O
as	O
embedded	B-Architecture
devices	I-Architecture
and	O
netbooks	B-Device
.	O
</s>
<s>
Such	O
devices	O
usually	O
use	O
flash-based	B-Device
storage	I-Device
,	O
which	O
has	O
limited	O
lifespan	O
due	O
to	O
write	B-Error_Name
amplification	I-Error_Name
,	O
and	O
may	O
also	O
use	O
it	O
to	O
provide	O
swap	B-Architecture
space	O
.	O
</s>
<s>
Using	O
zram	B-Application
or	O
zswap	B-Application
reduces	O
the	O
swap	B-Architecture
usage	O
,	O
which	O
effectively	O
reduces	O
the	O
amount	O
of	O
wear	O
placed	O
on	O
flash-based	B-Device
storage	I-Device
and	O
makes	O
it	O
last	O
longer	O
.	O
</s>
<s>
Using	O
zram	B-Application
also	O
results	O
in	O
significantly	O
reduced	O
I/O	B-General_Concept
for	O
Linux	B-Application
systems	O
that	O
require	O
swapping	O
.	O
</s>
