AI data centres have basically sucked up every RAM stick on the planet. If you want a 32GB kit of DDR5 right now, you’re looking at about $440, and that’s if you find a "deal." Some high-end 64GB kits are over $1,000 now.
So, since we can't afford real hardware, we’re going to use our 15GB of free Google Drive storage as a swap partition.
WARNING: This is a joke. Do not attempt this on a machine you value. Using cloud storage as a swap partition will result in extreme instability, potential data corruption, and kernel panics. Your internet latency is thousands of times slower than physical RAM; attempting to use it as system memory will effectively render your computer unusable.
Step 1: Set up the "Fake" Drive
First, you need to link your Google account to rclone. Open your terminal and run:
rclone config
- Type n for a new remote. Name it gdrive.
- Find the number for Google Drive in the list and type it.
- Leave
client_idandclient_secretblank - For "scope," choose
1(Full access). - Follow the browser prompt to log in and say "Yes" to all the permissions.
Step 2: Mount the Drive
Now we need to mount that drive so the OS thinks it's a real disk. We’re going to use --vfs-cache-mode full so it doesn't immediately crash when the swap starts writing.
mkdir ~/cloud_mem
rclone mount gdrive: ~/cloud_mem --vfs-cache-mode full --daemon
Step 3: Making the swap file
I'm using
doasfor escalating to root, you can also use sudo.
Now for the fun part. We’re going to create a swap file in your Google Drive.
dd if=/dev/zero of=~/cloud_mem/swapfile bs=1M count=12288 #12GB
chmod 600 ~/cloud_mem/swapfile
mkswap ~/cloud_mem/swapfile
doas swapon ~/cloud_mem/swapfile
Step 4: Maximizing the Suffering (Swappiness)
By default, Linux is smart enough to avoid using swap unless it absolutely has to. We want to be stupid. We want to force the computer to use our Google Drive even when it still has "real" memory available.
doas sysctl vm.swappiness=100
Your may computer freeze for 30 seconds every time you move your mouse, but at least you're saving money on new memory. ദ്ദി ˉ͈̀꒳ˉ͈́ )✧