Is It Possible to Use Flash Drives as RAM?

Finding ourselves at a loss of memory can be difficult when we’re performing an important task. If your system runs out of memory, some programs might crash and more often than not, the ones that do crash are the ones that you are using for work.

Sometimes, video games cause crashes through memory leaks or by filling up the memory if other software is running in the background, such as hundreds of browser tabs. Typically, virtual memory is used to replace RAM when there isn’t enough of it.

This slows things down tremendously because instead of using fast RAM directly connected to the CPU, the system turns to a hard drive or an SSD. If that is not an option for some people, using flash drives as RAM is another way to get more memory.

This is far from the most effective way of adding additional RAM to your system, but in case of an emergency, here is how to approach it.

Flash Drives as Additional Memory

Most systems can be set up to have additional virtual memory, which is known as SWAP on Linux systems. Even today, during most Linux setups, you reserve some drive space for a SWAP partition. This is used in case you run out of system memory.

For Windows, it should automatically start moving information to a drive, typically the system drive. However, you can choose to redirect the memory in both cases, for example, if you are running low on space.

Another reason might be having only hard drives as free space, which might be slower than flash memory. Prior to doing any “radical” changes with flash drives and storage drives, you might want to ask yourself how much RAM do I really need. It is always better to have more RAM than turn to virtual RAM.

Use Flash Drives as RAM – A Simple How To

Depending on the system you are currently using, here are easy steps on how you can use a flash drive as RAM.

Windows

The first thing to do is locate Advanced System Properties, which goes by the name of SystemPropertiesAdvanced.exe. You can find it either via the Control Panel or by searching for it in the Windows start menu.

Once it is open, head over to the advanced tab and open Settings for Performance. Head over to the Advanced tab in the newly opened window and open Change under Virtual Memory. To make any changes, you first have to disable Automatically manage paging file size for all devices.

After disabling that, select your flash drive and specify how much of the drive you want to be used as Virtual Memory. After you are done, you will need to restart the computer for the changes to take effect.

It goes without saying that you need to keep your flash drive connected at all times if you want to use it as virtual memory.

Linux

The first thing to do in Linux is to list all the drives and see which one is mounted under which name. The command lsblk should give you what you need. Locate your flash drive and memorize its name.

The following command is used to make your flash drive a part of virtual memory sudo mkswap /dev/your drive name where you would replace your drive name with the mount point for the drive, such as sdb, sdc, depending on how many drives you have installed.

The swap needs to be turned on so you should type sudo swapon /dev/your drive name, once more, specifying which drive is your swap.

If you already have another swap drive, you might want to turn it off or set the newly created one to have a higher priority.

In this case, the drive must also be plugged in all the time. Note that all the data on the drive will be lost once you turn it into a swap unit. Swap is handy to understand and you can always learn more about all things Linux oriented on the Arch Wiki.

Concerns With Using Flash Drives as Memory

Flash drives are fickle, at best. Having them plugged in all the time and working as virtual memory will kill them relatively quickly, depending on how much data is written. Even the best flash drives shouldn’t be used as virtual memory unless there isn’t a better option. If your memory is not working as it should be, you might want to test the RAM to see whether it is working properly.

If you don’t have enough memory, or if it has stopped working, you should add more if there is an opportunity to do so. If not, it is better to use storage drives rather than flash drives. Internal storage drives are built with storage in mind, writing and reading data.

Storage Drives Rather than Flash Drives

Hard drives are notoriously slow and will be slower than most flash drives. However, flash drives are connected to the chipset and not directly to the CPU, meaning that they have another hurdle to get over.

NVMe SSDs, on the other hand, are the fastest ones you can use for virtual memory, particularly if they are connected to the slot which is directly connected to the CPU.

As opposed to SATA SSDs and flash drives which use a slower protocol most of the time, NVMe drives are faster and use a faster protocol which relies on PCIe. This is the best option for virtual memory, and everything else is a compromise on the speed, performance, or life expectancy of the unit used as virtual RAM.

Conclusion – Flash Drives Aren’t the Best RAM Replacements

No drive will be as fast as RAM is, and you definitely do not want to use drives in a system that is RAM-sensitive, such as a professional or gaming rig. Gaming and RAM often go hand in hand and the faster the memory, the smoother the games are.

So, the question should not be how to use a flash drive as RAM, but rather, whether you should use it at all.

In case of an emergency, it can be done, but it won’t be fast nor particularly healthy for the drive. It should always be in the following order: RAM, NVMe, SATA SSDs, HDDs, and finally, flash drives.

Flash drives make poor choices for virtual memory, but they can help in case a problem arises.

About The Author

Milan Zagorac

Milan has always been interested in writing and technology, but managed to pick up a love for music, literature and sports along the way. Essentially a jack of all trades, his interest in all things tech as well as love for the written word, keeps him well occupied.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments