Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP -CALIBAN666-

1st December 2012, 12:06 PM   |  #1  
-CALIBAN666-'s Avatar
OP Recognized Contributor
Flag Leverkusen
Thanks Meter: 3,674
 
5,857 posts
Join Date:Joined: Feb 2012
Donate to Me
More
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!!!!
Last edited by -CALIBAN666-; 1st December 2012 at 12:22 PM.
The Following 78 Users Say Thank You to -CALIBAN666- For This Useful Post: [ View ]
1st December 2012, 12:36 PM   |  #2  
Senior Member
Flag Dhaka
Thanks Meter: 69
 
274 posts
Join Date:Joined: Jun 2012
More
Thanks for the info
1st December 2012, 01:07 PM   |  #3  
nikufellow's Avatar
Senior Member
simcity
Thanks Meter: 813
 
2,849 posts
Join Date:Joined: May 2012
Yeah thanks indeed for the info - so does this mean that we must have zram disabled because of low memory ?
1st December 2012, 01:17 PM   |  #4  
-CALIBAN666-'s Avatar
OP Recognized Contributor
Flag Leverkusen
Thanks Meter: 3,674
 
5,857 posts
Join Date:Joined: Feb 2012
Donate to Me
More
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
The Following 2 Users Say Thank You to -CALIBAN666- For This Useful Post: [ View ]
1st December 2012, 01:28 PM   |  #5  
nikufellow's Avatar
Senior Member
simcity
Thanks Meter: 813
 
2,849 posts
Join Date:Joined: May 2012
Quote:
Originally Posted by CALIBAN666

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 ?
1st December 2012, 01:29 PM   |  #6  
Junior Member
Tondo bayan ng mga GagO
Thanks Meter: 7
 
29 posts
Join Date:Joined: Nov 2012
More
in your statement zram is not battery friendly. ? am i correct. ? or not?
1st December 2012, 01:29 PM   |  #7  
nikufellow's Avatar
Senior Member
simcity
Thanks Meter: 813
 
2,849 posts
Join Date:Joined: May 2012
Sorry for too many questions mate - am the noobest guy here on xda that is why
1st December 2012, 01:39 PM   |  #8  
-CALIBAN666-'s Avatar
OP Recognized Contributor
Flag Leverkusen
Thanks Meter: 3,674
 
5,857 posts
Join Date:Joined: Feb 2012
Donate to Me
More
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.
The Following User Says Thank You to -CALIBAN666- For This Useful Post: [ View ]
1st December 2012, 01:41 PM   |  #9  
-CALIBAN666-'s Avatar
OP Recognized Contributor
Flag Leverkusen
Thanks Meter: 3,674
 
5,857 posts
Join Date:Joined: Feb 2012
Donate to Me
More
Quote:
Originally Posted by nikufellow

Sorry for too many questions mate - am the noobest guy here on xda that is why

no problem bro,thats the reason why i open this thread.and hey im noob too
The Following User Says Thank You to -CALIBAN666- For This Useful Post: [ View ]
1st December 2012, 01:42 PM   |  #10  
nikufellow's Avatar
Senior Member
simcity
Thanks Meter: 813
 
2,849 posts
Join Date:Joined: May 2012
Thank you

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes