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

Search This thread
V

vale amicis

Guest
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 :cowboy:
-CALIBAN666- for his thread
franciscofranco for his definition on zRam :)
abhisahara
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.

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!!!!:eek:



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 :fingers-crossed:
 
  • Like
Reactions: omerakgoz34
Jun 12, 2013
6
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..
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    V
    vale amicis
    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 :cowboy:
    -CALIBAN666- for his thread
    franciscofranco for his definition on zRam :)
    abhisahara
    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.

    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!!!!:eek:



    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 :fingers-crossed: