There are two types of memory in your computer - Hard disk and RAM. Hard disks are cheaper to store huge amounts of data, but slower than RAM. RAM is much costlier, but is the fastest to access small pieces of data which is what programs need.

Hence your computer first transfers data into RAM when a program starts, so it can access pieces of it faster from RAM. If these small pieces of data were accessed directly from the hard drive, it would be around 10 times slower.

This is exactly why your computer slows down when RAM gets filled up due to too many memory hungry processes.

But for any average user, this is not a daily scenario. Your computer would have enough RAM for your day to day activities, but only chokes up during the occasional heavy usage.

If you get into the SLOW scenario daily, it is best to upgrade or increase your RAM. But for the occasional scenario, you could easily use your pen drive as an extended RAM and maintain a decent PC performance.

Lets see how to do this for Windows and Linux.

Use pen drive as RAM in Windows.

For Windows XP, you need to use programs like ebooster. For Windows Vista and above (Vista, Windows 7, 8 and 10), you can use the inbuilt ReadyBoost feature.

When you insert your pen drive into the computer, you'll see an AutoPlay dialog box if you have not disabled AutoPlay.

Just click on the "Speed up my system" button and windows will start a series of tests to check if your drive is capable of being added as a RAM extension. Your pen drive needs to have -

  • At least 256MB in size, with at least 64KB of free space.
  • At least a 2.5MB/sec throughput for 4KB random reads.
  • At least a 1.75MB/sec throughput for 1MB random writes.

If these specifications look alien code to you, don't worry - just use a USB 2 or higher pen drive and you will be fine.

If the device is compatible, you can select the "Use This Device" or the "Dedicate This Device to ReadyBoost" option to enable ReadyBoost and specify how much space you want to make available to the disk cache. Using the "Dedicate this device" is recommended to avoid accidental deletion of anything in the RAM portion of the pen drive.

Even if you have disabled AutoPlay, you can access ReadyBoost from the right click context menu of your USB drive.

A cool feature of ReadyBoost is that all the data written to the pen drive is also mirrored on to the hard disk as well. That means even if you accidentally remove the pen drive, Windows will just continue with the data from your hard-disk. Although this will make the computer slower, it makes sure your computer doesn't hang up on you.

Also, the cache data written to your pen drive is encrypted using the AES 128 standard. So you don't have to worry about someone stealing any data from the cache written into your pen drive.

Use pen drive as RAM in Linux.

Linux uses a separate partition called swap to cache data when RAM gets filled up. So the trick to use a pen drive as RAM  in Linux is to replace the partition mounted as swap with the pen drive.

The first step is to find out the partition name of your pen drive.  Use the following command -

sudo fdisk -l

This will show you the details of all your available drives. You can easily find out the partition name of your pen drive from the list. Here is an example where I have a 4Gb pen drive -

The partition name here is /dev/sdc1. The next step is to unmount your USB drive with the following command -

sudo umount /dev/sdc1

Now you need to create your swap file on the pen drive with this command -

sudo mkswap /dev/sdc1

Finally, turn on the new swap file with this command -

sudo swapon -p 32767 /dev/sdc1

That's it. Your Linux OS will now use the pen drive to perform any swapping operations whenever your RAM gets filled up.

To make sure your new pen drive swap is active, use the following command -

cat /proc/swaps

You should see your pen drive partition listed.

Important: When you use mkswap command on your pen drive, the existing data on your pen drive will be lost. So make sure to USE CORRECT PARTITION NAMES. For instance, if you accidentally use a different partition name, the data in that partition (which might be your hard disk) could be lost forever.

Things you should know.

Using a pen drive as a RAM extension will defenitely increase the performance, although it won't really match the original RAM. Another important thing to keep in mind is that pen drives have a limited read/write cycles after which they will stop working. The regular sequential read/writes to the USB  pen drive will reduce the life of the drive itself.

It is best to use your pen drive as a RAM only occasionally when you feel your PC is running out of RAM and don't use it as a permanent RAM extension or swap. Other wise, your pen drive would last only a few months for sure.

Do you think knowing this a bit earlier would have made life easier? Please subscribe to skipser via email, RSS, Facebook, Twitter or Google+ so you don't miss similar free updates.

Also see: The silliest calculator bug ever.