Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,401 Members 39,029 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
-CALIBAN666-
Old
(Last edited by -CALIBAN666-; 1st December 2012 at 11:22 AM.)
#1  
-CALIBAN666-'s Avatar
Recognized Contributor - OP
Thanks Meter 3223
Posts: 5,461
Join Date: Feb 2012
Location: Leverkusen
Default (INFO)What is zram and how does it work???

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!!!!
The Following 71 Users Say Thank You to -CALIBAN666- For This Useful Post: [ Click to Expand ]
 
l0lh4rd
Old
#2  
Senior Member
Thanks Meter 69
Posts: 272
Join Date: Jun 2012
Location: Dhaka
Thanks for the info
http://img715.imageshack.us/img715/4052/condescendingwonka.jpg
 
nikufellow
Old
#3  
nikufellow's Avatar
Senior Member
Thanks Meter 809
Posts: 2,849
Join Date: May 2012
Location: simcity
Yeah thanks indeed for the info - so does this mean that we must have zram disabled because of low memory ?
 
-CALIBAN666-
Old
#4  
-CALIBAN666-'s Avatar
Recognized Contributor - OP
Thanks Meter 3223
Posts: 5,461
Join Date: Feb 2012
Location: Leverkusen
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: [ Click to Expand ]
 
nikufellow
Old
#5  
nikufellow's Avatar
Senior Member
Thanks Meter 809
Posts: 2,849
Join Date: May 2012
Location: simcity
Quote:
Originally Posted by CALIBAN666 View Post
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 ?
 
ewat
Old
#6  
Junior Member
Thanks Meter 7
Posts: 29
Join Date: Nov 2012
Location: Tondo bayan ng mga GagO
in your statement zram is not battery friendly. ? am i correct. ? or not?
 
nikufellow
Old
#7  
nikufellow's Avatar
Senior Member
Thanks Meter 809
Posts: 2,849
Join Date: May 2012
Location: simcity
Sorry for too many questions mate - am the noobest guy here on xda that is why
 
-CALIBAN666-
Old
#8  
-CALIBAN666-'s Avatar
Recognized Contributor - OP
Thanks Meter 3223
Posts: 5,461
Join Date: Feb 2012
Location: Leverkusen
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: [ Click to Expand ]
 
-CALIBAN666-
Old
#9  
-CALIBAN666-'s Avatar
Recognized Contributor - OP
Thanks Meter 3223
Posts: 5,461
Join Date: Feb 2012
Location: Leverkusen
Quote:
Originally Posted by nikufellow View Post
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: [ Click to Expand ]
 
nikufellow
Old
#10  
nikufellow's Avatar
Senior Member
Thanks Meter 809
Posts: 2,849
Join Date: May 2012
Location: simcity
Thank you

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes