HexaLab

GhostRAM Link: can your phone's RAM help a PC that's out of memory?

HexaLab's open experiment: phone RAM as an encrypted Linux swap tier over USB, no root. Sourced latencies, a simulator, a real-kernel test, and code to try.

By HexaLab · · 4 min read

In 30 seconds

  • A phone's RAM can never become real RAM for a PC. It can be an encrypted swap tier, over a USB cable, with no root on the phone.
  • On its own it is no faster than a cheap laptop's eMMC. The value comes from prefetching: replaying an app's recorded order made a real Linux workload 2.6× faster.
  • Everything is open on GitHub (ghostram-link): phone server, PC scripts, benchmark, simulator. Try it, measure your phone, and judge for yourself.
Contents 6
  1. Why "+8 GB virtual RAM" is always swap
  2. How GhostRAM Link works
  3. Prefetching: where the value really is
  4. What the simulator predicts for a cheap laptop
  5. Try it, and share your numbers
  6. HexaLab's take

Can the 8 or 12 GB of RAM in your phone help a laptop that keeps running out of memory? On 21 November 2026 HexaLab published GhostRAM Link, an open experiment that answers with numbers rather than promises. A phone's memory can never become real RAM for a PC. It can become an encrypted swap tier, reached over a USB cable, with no root on the phone. On its own that tier is no faster than the cheap eMMC storage in budget laptops. Combined with prefetching, which replays the order in which an app touched its memory last time, a real Linux workload ran 2.6× faster in our test. The code is on GitHub: try it, measure your own phone, and judge.

Why "+8 GB virtual RAM" is always swap

Many Android phones advertise "RAM Plus" or "8+8 GB": half of that is storage used as swap. The same physics applies between a phone and a PC. The CPU reads RAM through its own memory controller in about 0.1 µs. Anything behind a cable has to be fetched as a block, through a driver, and copied back. Phones have no PCIe link to a PC (no USB4 or Thunderbolt), so a CXL-style memory expansion is out of reach.

So the real question is: how fast can a PC fetch one 4 KB page from a phone, compared with the disk it would otherwise swap to?

Latency of one 4 KB page (µs, median)
NVMe Gen449 µs
NVMe Gen383 µs
USB 3 SSD (T7)190 µs
Phone, USB 3 raw220 µs
Laptop eMMC414 µs
Phone, USB 3 TCP550 µs
Phone, USB 2 TCP1000 µs

NVMe, USB SSD, eMMC: CrystalDiskMark Q1T1 (SSD-Tester, Notebookcheck). Phone rows: derived from USB benchmarks and tether pings.

Nobody had published a measurement of fetching a page from a phone's RAM over USB, so the phone rows are derived:

  • Raw USB 3: published round trips (160 µs minimum on a USB 3 radio, 190 µs per 4 KB on a USB SSD) put a raw path at around 220 µs.
  • Network over USB: an Android USB-tethering ping is 0.5 to 1 ms. That network path is what works without root.
  • A warning: the stock Linux USB-network gadget can stall for over 200 ms under load.

The repository includes a benchmark to replace these estimates with real numbers.

The design uses only standard pieces, so anyone can audit it.

From a full RAM to the phone and back
  1. 1RAM full

    Linux evicts pages it has not used recently

  2. 2zram first

    Pages are compressed in RAM (priority 100)

  3. 3Encrypt

    dm-crypt (AES-XTS) with a random key that never leaves the PC

  4. 4Phone RAM

    NBD over USB to a Termux server, no root (priority 50)

  5. 5Disk last

    Normal disk swap remains the final fallback

On the phone, a small Python server runs in Termux (ghostram_nbd.py). It serves a block of RAM over the standard NBD protocol. Memory is only allocated when the PC writes to it, and given back to Android when the PC discards it. We tested it with two independent clients, qemu-io and nbdinfo: reads, writes, flush, discard and out-of-range errors all behave correctly.

On the PC, three scripts:

  • ghostram-up.sh connects through adb forward, encrypts the device and enables it as swap.
  • ghostram-down.sh brings every page home before you unplug.
  • ghostram-watch.sh lets the phone decide: when its battery is low, it is too hot or it runs short of RAM, the tier is drained gracefully before anything can be lost.

Prefetching: where the value really is

A swap tier slower than your disk is useless, unless the PC asks for pages before the app needs them. Many heavy apps touch their memory in the same order every time: an AI model streaming its weights, a game loading a level. ghostprofile.py records that order once, then replays it: it reads /proc/PID/pagemap to see where the app is, and calls process_madvise(MADV_WILLNEED) (Linux 5.15 and later) to bring the next pages back early. No kernel module, no eBPF.

We ran it on a real kernel (Linux 6.18):

  • Setup: a container limited to 96 MB of RAM, a 192 MB working set read in a fixed order, and swap on an SSD.
  • Trials: five runs per setting.
Time to read the 192 MB working set once (s, median of 5)
No prefetch6.38 s
Profile, 1 024 pages ahead4.8 s
Profile, 4 096 pages ahead2.42 s
Wrong profile7.18 s

HexaLab real-kernel test, tests/RESULTS.md in the repository

  • Right profile: 2.6× faster.
  • Wrong profile, recorded on a different access order: 15% slower. Prefetching is a bet, and the tool still needs an "accuracy gate" that stops it when its hints go unused.

This test swapped to an SSD, not to a phone.

What the simulator predicts for a cheap laptop

To compare tiers we can't all test, the repository includes a simulator fed with the sourced latencies above. It replays five workload shapes on a laptop that has run out of RAM:

Slowdown vs unlimited RAM (lower is better)
AI weightsGameDatabase
zram + eMMC (today)289×78×132×
zram + phone USB 3326×82×146×
zram + phone USB 3 + profile46×15×565×
zram + NVMe43×12×20×
zram + NVMe + profile3.6×2.2×36×

GhostRAM Link simulator, sim/results in the repository

  • The phone alone is not faster than eMMC.
  • With profiles, it becomes up to 6× faster than eMMC on repeatable workloads, and 30 to 165× faster than an old hard drive on those same workloads.
  • Random access (the database column) is punished hard by prefetching.
  • On a laptop with an NVMe SSD, the phone is pointless.

The profile gain also assumes the USB link keeps several requests in flight. That is one more thing your measurements will confirm or refute.

Try it, and share your numbers

# Phone (Termux, no root)
pkg install python
curl -LO https://raw.githubusercontent.com/djalaa966/ghostram-link/main/bench/page_server.py
python page_server.py

# PC
adb forward tcp:10810 tcp:10810
python bench/page_client.py --label "my phone, USB 3 cable" --json my-phone.json

If the median you measure is above your disk's latency, the phone tier will not help that machine. If it is below, follow the README to attach the tier, and read docs/SAFETY.md first. Please share your results in a GitHub issue (phone model, cable, USB version). The first real measurements of this path will come from readers.

Prior art: none of the building blocks is new.

  • Borrowing another device's memory: Micron's Memory as a Service patents, Infiniswap, Windows ReadyBoost.
  • Replaying an app's recorded access order: the Windows Prefetcher, TPP, 3PO.

What GhostRAM Link adds is an open, no-root and measured combination for ordinary phones and laptops. The sources are listed in docs/RESEARCH.md.

HexaLab's take

GhostRAM Link will not turn 8 GB into 16 GB, and we would rather say so than sell a miracle. What it shows is more interesting: the bottleneck is when a page arrives, not where it lives, and a recorded access order can hide most of the wait. Whether a phone over USB is good enough for that on your machine is an open question. The tools to answer it are now public.

Verified sources

  1. GhostRAM Link — source code, docs and results (GitHub) github.com
  2. SanDisk DF4032 eMMC benchmark (Notebookcheck) notebookcheck.net
  3. Samsung 970 EVO Plus RND4K Q1T1 (SSD-Tester) ssd-tester.com
  4. Samsung Portable SSD T7 RND4K Q1T1 (SSD-Tester) ssd-tester.com
  5. USB gadget NCM latency under load (aurora-silicon/linux #2095) github.com
  6. process_madvise(2) — Linux manual page man7.org
  7. Micron — Memory as a Service (US11100007B2) patents.google.com
  8. 3PO: programmed far-memory prefetching (arXiv 2207.07688) arxiv.org

Written and checked by HexaLab from the sources listed.

Share WhatsApp LinkedIn X Facebook