(INFO)What is zram and how does it work???

Status
Not open for further replies.

-CALIBAN666-

Senior Member
Feb 24, 2012
6,752
4,287
253
39
Leverkusen,Rheindorf
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:
 
Last edited:

nikufellow

Senior Member
May 14, 2012
2,967
843
0
simcity
no its very good for devices with less ram like 289mb and we have less ram,so its useless for higher ram devices with 800-1000,but that can u read in this guide;)
Yeah i misunderstood thanks for explaining !
But one more doubt - its good for us anyhow if we disable it will we get more free ram ?
 

-CALIBAN666-

Senior Member
Feb 24, 2012
6,752
4,287
253
39
Leverkusen,Rheindorf
not really because the system all the time creates virtual ram and distributed, just as if the ram is not needed, because then the virtual ram not needed and the system distributes it then falls to a normal ram, but I think it also comes to the what and how much the device is made for running multiple concurrent tasks, it is recommended.
 
  • Like
Reactions: nikufellow

irfanbagus

Senior Member
Mar 12, 2012
307
498
0
@CALIBAN666

ramzswap != compcache. both using compressed data on memory. both even from the same person AFAIR. the different is ramzswap using compressed swap and compcache using compressed cache.
kernel 2.6.35 source code from samsung have ramzswap support, but you need user space program to enable it (need little patch to build it for sgy but it's easy).
 
  • Like
Reactions: savie

hell_lock

Inactive Recognized Developer
Jan 20, 2012
5,972
5,173
0
23
New Delhi
@CALIBAN666

ramzswap != compcache. both using compressed data on memory. both even from the same person AFAIR. the different is ramzswap using compressed swap and compcache using compressed cache.
kernel 2.6.35 source code from samsung have ramzswap support, but you need user space program to enable it (need little patch to build it for sgy but it's easy).
Can u help me on enabling ramzswap?? Zram is laggy

Sent from my GT-S5360 using XDA
 

shubhs4frndz

Senior Member
Sep 29, 2012
64
16
0
I tried swapper for my galaxy y n i didnt liked it personally
By that time i had stock sd card
Im gonna try zram on my 16 gb class 6 sd card..i wish this thing works for me cuz after installing merruk kernel, my 50 mb ram got stuck

Sent from my GT-S5360 using xda app-developers app
 
May 16, 2012
35
21
0
ecelis.sdf.org
swapp != zram

Not understood... Android has no swap? Then what is swapper for? Swapping partition?
With swapper you can have an swap file or you can choose to partition your SD-Card to have an swap partition there. Swap is not used by default in Galaxy Y and swap space is optional not really needed in Android (or Unix/Linux in general).

On the other hand, zram is a whole different beast.
 
Status
Not open for further replies.