Skip to main content

What is Virtual RAM in a phone? Is it beneficial?

Virtual RAM is no longer foreign to the world of smartphones. While the feature has been long in action for PCs, it’s only recently that we are seeing its widespread use on smartphones. Phone manufacturers use multiple marketing terms to advertise the feature on their phones, but it is basically the same thing every time. Midrange phones introduced the Virtual RAM feature first, but it is slowly coming to high-end phones as well. But what is Virtual RAM? Here’s an explainer to help.

What is Virtual RAM?

The term Virtual RAM refers to RAM that isn’t physically present on your device (like normal RAM is), but comes into use when required. For those unaware, RAM (or Random Access Memory) is a high-speed storage component in charge of remembering your data on a temporary basis. This is unlike your internal storage, where data is stored permanently. RAM is a lot faster than eMMC or UFS 3.1 storage used for prolonged storage. Basically, while internal storage stores data like images and videos, RAM remembers which apps you have open, and what you were doing the last time you had them open.

RAM expansion illustration
Realme

By doing this, RAM allows you to load apps as quickly as possible. Whenever you open an app, it’s stored in RAM, allowing it to be quickly accessed. So technically, more RAM enables you to have a higher number of apps in the background and reopen them quickly with minimum lag or delay.

The idea of Virtual RAM is to provide extra RAM when required — but how does it do this without physically adding more RAM? By using onboard storage as RAM. How do you know if you have this? Well, each manufacturers has come up with their own marketing terms, so you might need to do some digging. For example, Samsung calls it RAM Plus, Realme uses the term Dynamic RAM Expansion, and Vivo labels it as Virtual RAM.

How does Virtual RAM work on Android?

How does Virtual RAM work? The simple answer is it allocates a certain amount of space from your main storage — so 4GB, 6GB, etc. But, to completely understand the workings of Virtual RAM, we must first understand how memory management on Android works.

An Android device is equipped with three kinds of memory — RAM (LPDDR4, LPDDR4x), internal storage (eMMC or UFS), and zRAM, the latter of which is basically a partition inside your RAM that stores low-priority compressed data running in the background. This is done to allow space on your RAM for the app or apps running in the foreground.

Memory management diagram
Image used with permission by copyright holder

Android uses a process called paging for memory management. In paging, RAM is broken into small pieces called “pages,” which are mostly around 4KB each. The amount of used RAM is determined by the number of free or actively used pages. In Android, you see this information under the recent apps. If you haven’t noticed yet, the picture below will help.

Recent apps window
Recent apps window showing used and empty RAM. Image used with permission by copyright holder

Pages are defined into two types — “clean pages” and “dirty pages”. Clean pages have an unmodified copy of data saved in the storage, while dirty pages keep a modified copy. An unmodified copy is static data that doesn’t change, while a modified copy is dynamic data that changes every moment. Android can get rid of clean pages when they do not need access to resources, freeing up space in RAM.

This sounds complicated, but it’s easier to understand through some real-life examples. Apps like Facebook, Twitter, and Reddit use clean pages and tend to remain static when placed in the background. For instance, when you launch Facebook and move to Twitter later, Facebook is stored in your phone’s RAM, but it doesn’t refresh in the background. So when you get back to Facebook again, it shows the timeline you left off at before refreshing.

On the other hand, music streaming apps and YouTube use dirty pages, so they keep running even when the app is not open. As such, these apps use RAM dynamically, and cannot be closed. So to save space, these apps are compressed and sent to zRAM, making sure the app remains open in the background.

Virtual RAM uses internal storage on your device by creating a swap partition that acts as zRAM. Budget phones ship with a limited amount of RAM, so manufacturers use this technique to expand RAM virtually. It’s worth noting that the feature does not bump up the physical RAM present on the device. So, even if you toggle the Virtual RAM feature, the amount of physical RAM will remain the same.

Is Virtual RAM beneficial for your phone?

The Virtual RAM feature allows you to run more apps on your phone, but it’s not often seen on flagship smartphones. Why? Because leveraging storage space like this makes the most sense on an entry-level device that has a limited amount of RAM to begin with. Higher-end Android devices now tend to ship with 12GB or 16GB of RAM, which is already an enormous amount of RAM, so the feature is less likely to make a difference here.

It’s also worth noting that the feature involves constant reading and writing, which is not good for flash memory, as they have limited read and write cycles. So frequent use of internal storage for Virtual RAM reduces your storage’s life.

Why are we seeing the Virtual RAM features on phones now?

Virtual RAM has been around for a while now, just not on smartphones. PCs come with this feature built-in, and it used to be only rooted smartphones that allowed this feature. But we’ve recently seen manufacturers starting to ship phones with this feature built-in. This is likely because apps are much larger these days and take up more resources, including RAM. Hence, this feature provides users with more RAM, without needing to add more physical RAM to a smartphone (pushing up costs).

So, is this a good thing? Not really, as this feature can do more harm than good where internal storage life span is concerned. This is a major reason why Google has avoided this feature for so long, as highlighted on the Android developer page. “On Android, storage isn’t used for swap space like it is on other Linux implementations since frequent writing can cause wear on this memory and shorten the life of the storage medium.”

Editors' Recommendations

Topics
Ayush Chourasia
Ayush works as an independent tech journalist. He has been writing since 2018 and has worked with publications like India…
How much RAM does a smartphone actually need? We asked the experts
woman looking at cell phone

Buying a smartphone today can be confusing. Long specification sheets are crammed with numbers, and their relationship with real-world performance is not always clear. One of the most misunderstood of all those specs is RAM, or Random Access Memory.

If you’re wondering how much RAM your smartphone needs, then you’re not alone. This question has popped up again and again since the dawn of the smartphone. We decided to ask some experts about how much RAM the average person really needs, what it does, and how it works.
What does RAM do?
“Smartphones have come a long way in the last few years and do more for us now than ever,” Vishal Kara, head of product at Piriform (the makers of CCleaner for Android) told Digital Trends. “As we perform more and more tasks using our smartphones, more RAM is necessary for them to continue functioning efficiently.”

Read more
Will that unlocked phone work with your wireless carrier? Here’s how to tell
samsung galaxy s21 ultra review screen front

The days of immediately signing up for a new device when your phone contract is up are over. These days, a decent smartphone can see more than a couple of summers, so why upgrade when there's life in the old dog yet? Switching to a new carrier with your existing phone is an excellent way to save money, and thanks to phone unlocking, easier than ever.

But, as much as we hate to be the bearers of bad news, there may be reasons you can't move to a specific carrier -- and those reasons may be your smartphone's bands. While many smartphones are capable of working on most smartphone bandwidths available in the U.S., there are some that cannot, and the last thing you want to do is lock into a new contract and then find out your phone is incompatible with the carrier's choice of bands.

Read more
OnePlus 9 vs. Samsung Galaxy S20 FE: What’s the best value phone?
oneplus 9 vs samsung galaxy s20fe s20 fe

OnePlus is facing more competition than ever. In previous years, the company has offered phones with near-flagship specs for a few hundred dollars cheaper than the competition. Last year, however, Samsung launched the $700 Galaxy S20 FE -- a device that borrowed the best things about the Galaxy S20, but came in at a much lower price. Considering that it now often costs just $600, and that the OnePlus 9 comes at $730, the OnePlus 9 has an uphill battle ahead of it in this war between value phones.

The Samsung Galaxy S20 FE may be aging a little, but Samsung still sells it -- meaning you might be wondering which device you should buy. I've used and reviewed both phones. Here are my thoughts.
Design and display
The Galaxy S21 may have a radical and unique new design, but the Galaxy S20 FE sticks to many of the design elements that you would expect from a 2020 phone. It's not the most exciting-looking device -- and it's definitely not ugly, but it feels like every flagship phone last year came with a rectangular camera bump at the top left and a hole-punch cutout on the display.

Read more