Does Virtual RAM actually make a difference?

Hello there. You may be a non-techie reading this and came across this article. Want to learn something new? I got the piece just for you. *wink*

There have been emerging numbers of new smartphones and computers bundled with existing physical RAM (Random Access Memory) and virtual RAM. The term Virtual RAM is no longer foreign to the world of smartphones. While the feature has been long in action for PCs, it’s only a few recent years that we have seen its widespread use on smartphones. So, let's explore what virtual RAM is all about.

What exactly is Virtual RAM?

Virtual RAM, or virtual memory, is a kind of RAM that isn't physically there because it serves as a pivotal memory management mechanism within operating systems. Its primary role is to create an illusion of expanded memory capacity beyond the physical RAM available in a computer. In essence, it provides a means to augment a computer's memory resources by utilizing a portion of the storage device, typically a hard drive or SSD, as a supplement to the physical RAM.

Let's break down how Virtual RAM works in mobile and computer operating systems.

Physical RAM: Every computer possesses a fixed quantity of physical RAM, consisting of memory chips on the motherboard. Data retrieval from this physical RAM is considerably faster than accessing data stored on storage drives.

Virtual Memory: When the physical RAM proves inadequate to manage all active processes and data, the operating system creates a designated virtual memory space on the storage device. This space effectively represents a segment of your storage drive reserved for utilization as "virtual RAM."

Page File or Swap Space: In the Windows environment, this virtual memory is commonly known as a "page file," whereas in Linux and other Unix-based systems, it is referred to as "swap space." These files or partitions on the storage device serve as temporary repositories for data that would typically reside in physical RAM.

Page Swapping: As the physical RAM reaches its limitations, the operating system relocates less frequently accessed data from RAM to the page file or swap space. This action frees up physical RAM for more critical operations. When necessary, the operating system will transfer this data from the page file back into RAM.

Performance Considerations: While virtual RAM empowers a computer to run a broader range of applications and handle larger datasets, it should be noted that it operates significantly slower than physical RAM. Accessing data from a storage device is substantially slower than retrieving data from RAM. Overreliance on virtual RAM can lead to noticeable performance degradation.

How Virtual RAM works for Android phones

It's no doubt that Android OEMs have embraced virtual memory technology to keep their phones running "smoother". So based on how Android Memory Management works in the Operating System, how well does it work on Android devices?

For starters, 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.

Source: Android Developers

In memory management, Android uses a process called paging, where 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. Some Android OEMS may indicate the extra virtual RAM  available under the multitasking window for recent apps, but some may not.

How Virtual RAM works for Windows PCs

Virtual memory works through a temporary process, known as swapping, that combines RAM with space on the hard disk. On a PC, RAM is the physical memory where operating system data, running programs and open documents are held. When RAM runs low, virtual memory can move data from the RAM to a space called a paging file. This process allows for RAM to be freed up so that a computer can complete the task.

Occasionally a user might be shown a message that says the virtual memory is running low. This means that either more RAM needs to be added, or the size of the paging file needs to be increased. Typically, operating systems such as Windows will manage this process automatically. It can also be changed manually if the default size of the virtual memory isn’t large enough.

RAM data can change at any time. For example, a user might only have one program or one document open, sometimes they might have numerous programs and documents open. The more RAM a device has, the more data and programs it can run at the same time.

There will be times when a device has too many programs open and not enough RAM to run them. Transferring data from the RAM to the hard disk frees up RAM; this data isn’t being used at the time.

Perfect use cases for Virtual RAM

There are probably a number of use cases for Virtual RAM, but a few stand out as follows:

Gaming – Virtual RAM may not directly boost the gaming performance of the device as the majority of the processing power is handled by the chipset. However, extending the RAM will allow you to keep more apps running in the background which might not reload once you open them after long gaming sessions.

Multitasking – If you often switch between multiple apps, enabling Virtual RAM may allow you to keep more apps in the memory, at least the static ones such as dialler, clock and calculator.

Faster Camera processing – With extra RAM in the system, a phone may quickly process clicked pictures as it can utilise more resources than before.

So, is Virtual RAM that useful? (Related to Android)

Recently, there was an online discussion on X (formerly Twitter) about the RAM usage on our Android phones across all the brands we use. Samuel Owino a.k.a SamProgramiz posted this poll:


I got tagged in the thread and I brought up the virtual RAM topic. Personally, I own a Samsung Galaxy A22 and I have the option to enable RAM Plus- which provides virtual memory of up to 4GB.

It turns out one of the users, Phillip Oroni a.k.a. phillipsfuture asked a valid question (that also made me write about this article in the first place)


My initial response was: It's hard to tell. Some heavy intensive apps may work well with virtual RAM to "boost" performance and function. While lighter apps remain the same. Especially when they are running in the background.

So, here's the reality check. 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. 

There is a downside to this, the feature involves constant reading and writing, which is not good for flash memory, as they have limited read and write cycles. Eventually, frequent use of internal storage for Virtual RAM reduces your storage’s life.

A good post that explains this issue and concern comes from the user Emmanuel Chenze a.k.a. echenze from Android Kenya;


Verdict

Virtual RAM on an Android phone may not perform as good as the actual hardware RAM present on a device. This is because the actual RAM has much superior memory transfer speeds as opposed to virtual RAM, which simply uses slower internal storage to expand the RAM. 

In simple terms, with virtual RAM enabled on an Android smartphone, the performance won’t be significantly better even more so for day-to-day tasks. 

There 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.”

Welcome to our comments section!
Leave us with your thoughts and comments.

Previous Post Next Post