Remove All Ads from XDA
Honor 9 Lite

[INFO][SHARE] What is zRam in Kernel?

n/a posts
Thanks Meter: 0
By vale amicis, Guest on 12th June 2013, 09:57 AM
Post Reply Email Thread
Some budding devs like me and some others have asked this question and got this answer!

Firstly I want to thanks all who supported me!

My Parents for buying me an Android Device and Supporting
-CALIBAN666- for his thread
franciscofranco for his definition on zRam
Sniper Killer

And all those whom I have forgotten to mention!


Originally posted by Wikipedia

Q: What is zRam?
A: zRam is a module of the Linux kernel, previously called "compcache". zRam increases performance by avoiding paging on disk and instead uses a compressed block device in RAM in which paging takes place until it is necessary to use the swap space on the hard disk drive. Since using RAM is faster than using disks, zRam allows Linux to make more use of RAM when swapping/paging is required, especially on older computers with less RAM installed.

Google has also said to enable zRam as default for Chrome OS Devices!


Originally posted by franciscofranco

The zram module creates RAM based block devices: /dev/ramX (X = 0, 1, ...).
Pages written to these disks are compressed and stored in memory itself.
These disks allow very fast I/O and compression provides good amounts of
memory savings.

Basically is for storing swapped pages into compressed memory ram.

Originally Posted by -CALIBAN666-

I think its better to Post this here,when its not better,than sorry!!!
Once a brief statement for those who are not traveling so long in the Android scene:
ZRAM = ramzswap = Compcache

In order to explain more precisely ZRAM first need other terms are more clearly defined:
Swap can be compared with the swap file on Windows. If the memory (RAM) to complete the PC the data that are being used not actively outsource (eg background applications) so as to re-evacuate RAM free. To this data is written to a hard disk. If required, this data is then read back from there easily. Even the fastest SSD is slower than the RAM. On Android, there is no swap!

In ZRAM unnecessary storage resources are compressed and then moved to a reserved area in the fixed RAM (ZRAM). So a kind of swap in memory.
This Ram is more free because the data then only about 1/4 of the former storage requirements have. However, the CPU has to work in more because they compress the data has (or unpack again when they are needed). The advantage clearly lies in the speed. Since the swap partition in RAM is much faster than this is a swap partition on a hard drive.

In itself a great thing. But Android does not have a swap partition, and therefore brings Android ZRAM under no performance gain as would be the case with a normal PC.

In normal PC would look like this:
Swap = swap file (on disk) -> Slow
ZRAM (swap in RAM) -> Faster than swap
RAM -> Quick

With Android, there is no swap partition, and therefore brings ZRAM also no performance boost.
The only thing that brings ZRAM is "more" RAM. Compressed by the "enlarged" so to speak of the available memory. That's on devices with little RAM (<256MB) also pretty useful. The S2 has 1GB but the rich, and more than. There must not be artificially pushed up to 1.5 GB.

After you activate the ZRAM also has 2 disadvantages. The encoding and decoding using CPU time, which in turn has higher power consumption.

Roughly one can say (For devices with more than 512MB RAM):
Without ZRAM: + CPU Performance | + Battery | RAM
With ZRAM: CPU Performance |-Battery | + RAM

For devices with too little RAM so it makes perfect sense. But who shoots the S2 already be fully complete RAM and then still need more?

Check whether you can ZRAM runs in the terminal with
free or cat / proc / meminfo

I hope it helps to understand zRam!!!!

So basically zRam module in kernel increases and optimizes performance!

I didn't write all this information, I just compiled it together in one thread for ease
The Following User Says Thank You to vale amicis For This Useful Post: [ View ] Gift vale amicis Ad-Free
12th June 2013, 10:16 AM |#2  
Account currently disabled
Thanks Meter: 1
But making it work is an headache.. you have to add LZO(Lempel–Ziv–Oberhumer) compression through menuconfig and then run zRam scripts through init.d and what not..
vale amicis
12th June 2013, 10:17 AM |#3  
Thanks Meter: 0
Originally Posted by robowarrior1377

But making it work is an headache.. you have to add LZO(Lempel–Ziv–Oberhumer) compression through menuconfig and then run zRam scripts through init.d and what not..

This thread is a information share thread

It is not a thread in how to enable it in your kernel -_-
12th June 2013, 10:23 AM |#4  
Andr0id7's Avatar
Senior Member
Flag Makati
Thanks Meter: 19
Thanks for the info

Sent from my GT-N8000 using xda premium
12th June 2013, 12:26 PM |#5  
Junior Member
Flag Jakarta
Thanks Meter: 6
Donate to Me
Question Zram = extravagant battery
so it makes wasteful battery zram?
excuse me if my English is poorly
14th June 2013, 10:54 PM |#6  
Junior Member
Thanks Meter: 4
gj man thanks for info very helpful
18th June 2013, 01:43 PM |#7  
Recognized Developer
Flag New Delhi
Thanks Meter: 5,257
Donate to Me
Change the first line of the thread.
Post Reply Subscribe to Thread

info, kernel, kernel info, what is zram?, zram

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes