Original topic:

Let's talk RAM Plus (Virtual RAM) in Galaxy smartphones.

(Topic created on: 05-30-2022 05:40 PM)
1524 Views
Anikroyale
Expert Level 5
Options
Tech Talk

I am sure everyone amongst you guys have heard about Virtual RAM. No? Let's understand what it is and let's see how it works in Galaxy smartphones (it is the same for all smartphones).


Virtual RAM is the RAM which is not a part of the high speed Random Access Memory (RAM). It is not a part of the DDR4, LPDDR4X or DDR5 etc. Virtual RAM is taken from your internal storage or Flash memory (UFS or eMMC) and is only taken into use when necessary. Virtual RAM has been present since 1985 and was first introduced by Intel in the 386 microprocessor family. Contrary to common belief, virtual RAM is an important part of any electronic gadget with a processing unit.


In Android, the size of virtual RAM is generally double the size of the amount of RAM present in it, and it is recommended that you set your devices' RAM Plus to the maximum amount available (RAM Plus in Samsung devices can be found under Device Care --> Memory). If your device does not have an option to select RAM Plus, then be known that the amount of virtual RAM in that device is always double the size of RAM present in the devices, because that is how Linux uses its file system and we all know that Android is based on Linux. SWAP partition is used in Linux and it is set to double the size of RAM while installing. It can be set to any size you want, but below double, you will face performance issues and above double, you will not see much difference.


The RAM in your device is insanely faster than the flash storage and hence you will see little to no performance differences in your device. But, if someone says that virtual RAM is a gimmick, let me tell you that it is not. If you remove SWAP from Linux (Android for that matter) or pagefile from Windows (both are different technologies for virtual RAM), you cannot use any of the applications you use because of insufficient memory errors. I have personally experienced this. The purpose of virtual RAM is to let you open applications, handle background tasks, so that the physical RAM can be used for other important workloads and help you have a better experience. So next time, if someone tells you that virtual RAM is unnecessary, tell them that even their devices have it and that those would be unusable without it.


So, that was today's Tech Talk, I will be back with another one really soon! Till then, take care.

15 Comments
TheMystic
Expert Level 1
Tech Talk
I disagree with your post. Do you have some links in support of what you have stated here?

You say virtual ram should ideally be twice the size of actual RAM. Then how come RAM Plus options are limited to 6 or 8 GB only? On a 12 GB RAM phone, the max RAM Plus available is only 8 GB.

Even the Page file on Windows is smaller than the actual RAM. Disabling it would not necessarily cause issues.

Virtual RAM is only a tool to keep apps open, instead of closing them down when running out of memory. Loading an open app from storage to RAM is faster than launching it fresh. That is the only advantage.

Without virtual RAM, the system is neither unstable nor will it cause memory errors. Applications would run fine without virtual RAM.
Tech Talk
Man virtual ram isnt required actually and virtual ram size on a 4GB Physical RAM windows 10 pc is about 2 to 3GB (4th Gen Intel Core i3 5500U CPU)
0 Likes
Anikroyale
Expert Level 5
Tech Talk
During installation, it is always required (atleast from the amount of times I have installed any Linux distro) to set SWAP size to double the RAM. In smartphones too, that's the case. Later on, it can be increased or decreased, which is exactly what is done. Samsung providing 8 GB on 12 GB phones is just Samsung doing it, not basic Linux. If you want, you can add upto any amount of virtual RAM you want (as long as it is in storage limits). Samsung not willing to provide more than 8 GB has nothing to do with basic facts.

Windows pagefile works completely differently and does not require to have double the amount of RAM, and it even creates the pagefile itself depending on your device and usage.

Disabling pagefile can have numerous issues. The system won't be unstable to say as such, but you will have a hard time to even do basic tasks like keeping apps open and opening browsers (especially on devices with less than 16 GB of RAM). This is what my personal experience says.
TheMystic
Expert Level 1
Tech Talk
Let's get some facts clear first.

Linux is a 'Kernel' that an 'Operating System' uses to run/ manage a device. Android is an Operating System designed for mobile devices, while Linux Distros are Operating Systems that are designed for Desktop Computers. Even though they use the same Kernel as a base, these are widely different in terms of implementation, design and function.

A Desktop OS manages hardware like memory very differently, given how widely different the applications that run on them are. Unlike a mobile device, Desktop OSes don't close applications randomly. That is why they need a large SWAP space to keep apps open in memory, even if in a suspended/ frozen state.

Moreover, Desktop OSes need to keep power requirements in mind too. Unlike mobile devices which run on battery 100% of the time, Desktop Computers tend to run on direct power supplies, which means they need to keep as much information in storage as possible, to enable data recovery in case of power loss.

Mobile OSes weren't designed to keep apps open in that manner. Although with advancements in technology and increased RAM in mobile devices today, the mobile OS too is trying to keep as many apps open in memory, as possible.

Virtual RAM in mobile devices is trying to achieve just this objective of using some part of the storage to save apps in an 'open' state, to enable loading them faster when launched by the user. It isn't a necessary feature and this is only a recent implementation in mobile devices.

So the point that they must be twice the RAM available or the claim that they have always been present are both factually incorrect. There is no OEM that provides twice the built-in RAM to be allocated to virtual memory. So Samsung isn't alone.

On a Windows PC, you CAN disable Pagefile, although it isn't recommended. Disabling it won't automatically cause issues. If you have a RAM big enough, you'll do just fine.
Gaurav_Sîngh
Active Level 6
Tech Talk
Yep I agree with you, I also feel that only advantage of virtual ram is that it keep apps in open state and sometimes load a larger ram required process to main memory.

Virtual memory is just a storage scheme that gives an illusion of larger RAM size. It still have some advantages like slower app switching(if the app pages or process are in secondary memory) and also heavily depend on how secondary storage speed like my support maybe UFS 2.0 so my virtual ram efficiency will be slower than a guy using UFS 3.0.

And I have installed nearly 5 Linux distribution till date but I don't remember setting any swap size at all(But my memory can be weak, so I am wrong don't get offended)
TheMystic
Expert Level 1
Tech Talk
It's only purpose is to keep apps open. There is no question of comparing speeds with RAM.

Given that devices today come with a large RAM, this is mostly a marketing tool for OEMs than one that offers too much benefits for the end user.
0 Likes
Gaurav_Sîngh
Active Level 6
Tech Talk
yep surely a gimmick for companies what's the need of virtual memory in a 8gb or 12 gb android.

Saw a A53 add last month and it was mentioned like 16 gb of ram and in small letters at below that 8 normal and 8 virtual ram
0 Likes
Anikroyale
Expert Level 5
Tech Talk
That is quite literally what I said in my post. Virtual RAM is not used to improve performance. Its used just to keep apps open in the background and it works fine on almost all storage systems (except eMMC and UFS 1.x).

And regarding SWAP, if you don't put in the SWAP value while installation, most distros will automatically set it (to double the size of RAM).
0 Likes
Gaurav_Sîngh
Active Level 6
Tech Talk
Ok thanks for doubt clarification
0 Likes