In the last post I made, I talked about smartphone RAM. What it is, how it works, the different types as well as other key specs. When I was done, I said I was going to do a post on zRAM. So in this post, I am going to be tackling the question, what is zRAM?
What is zRAM?
zRAM is a partition of RAM that is designed to hold compressed app processes. An App Process is the data of an app (currently in use) that is saved to RAM.
In Linux terms, the ‘z’ stands for compressed. The zRAM resides within the main RAM module and can be thought as a block of RAM which holds low priority data that is compressed.
Function
This part is simple enough. It holds compressed app processes which are in memory but are not currently in use.
How does zRAM work?
Our smartphones, especially Android phones, have the ability to multitask. When you boot up an app, important data needed for the app to run is saved to the RAM. This makes it easier for the CPU cores to access and process such apps.
The more apps that you open, the more app processes that you create. All app processes are saved to RAM. This will continue until the RAM gets filled up. Of course, the RAM is going to get filled up at some point. The space is not infinite.
At this point, the operating system (OS) is going to take a look at the app processes that sitting in the RAM. If an app process has been sitting in the RAM for hours, without being touched, the OS would conclude that such an app is not important. Such apps are termed low-priority apps.
The OS would compress such low priority apps to smaller sizes and push them out of the main RAM into the zRAM. Sometimes, it is the zRAM itself that does the compression. This action would then create space for a newer app process to be loaded into the RAM.
In RAM management, this entire process is known as compressing/compression. The naming depends on where you get your information.
Read: RAM, Internal and External storage explained
Decompressing
If for some reason, the user decides reopen an app whose process is stored in the zRAM, the OS would decompress the app back to it’s full size. The OS will then restore the app process back to the RAM.
In Summary…
What is zRAM? zRAM is a block of RAM that holds compressed app processes. How does it do this? Simple, by acting as a storage area for low priority data. It will hold this data until it (i.e. the data) is needed.
Basically, zRAM is a very intelligent way for smartphones to multitask efficiently and effectively.
Please leave a comment if you have any difficulty and remember to:
- Subscribe to our YouTube channel
- Follow on Facebook
- Join our Telegram community
- Participate on Reddit
- Find us on Quora
- Follow us on Instagram
- Check out the Clubhouse as well