{"id":13809026,"url":"https://github.com/pojntfx/ram-dl","last_synced_at":"2025-10-13T16:31:02.989Z","repository":{"id":177561812,"uuid":"660555341","full_name":"pojntfx/ram-dl","owner":"pojntfx","description":"A tool to download more RAM (yes, seriously!)","archived":false,"fork":false,"pushed_at":"2024-07-30T00:40:19.000Z","size":1281,"stargazers_count":145,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-23T14:09:52.905Z","etag":null,"topics":["nbd","r3map","ram","swap"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pojntfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-30T09:16:19.000Z","updated_at":"2025-01-18T08:48:13.000Z","dependencies_parsed_at":"2023-09-24T01:28:08.005Z","dependency_job_id":"43f1c3c9-b657-415a-8574-746febd634c7","html_url":"https://github.com/pojntfx/ram-dl","commit_stats":null,"previous_names":["pojntfx/ram-dl"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pojntfx%2Fram-dl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pojntfx%2Fram-dl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pojntfx%2Fram-dl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pojntfx%2Fram-dl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pojntfx","download_url":"https://codeload.github.com/pojntfx/ram-dl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236369139,"owners_count":19138054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nbd","r3map","ram","swap"],"created_at":"2024-08-04T01:01:58.412Z","updated_at":"2025-10-13T16:30:57.705Z","avatar_url":"https://github.com/pojntfx.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cimg alt=\"Project icon\" style=\"vertical-align: middle;\" src=\"./docs/icon.svg\" width=\"128\" height=\"128\" align=\"left\"\u003e\n\n# ram-dl\n\nA tool to download more RAM (yes, seriously!)\n\n\u003cbr/\u003e\n\n[![hydrun CI](https://github.com/pojntfx/ram-dl/actions/workflows/hydrun.yaml/badge.svg)](https://github.com/pojntfx/ram-dl/actions/workflows/hydrun.yaml)\n[![Matrix](https://img.shields.io/matrix/go-nbd:matrix.org)](https://matrix.to/#/#ram-dl:matrix.org?via=matrix.org)\n\n## Overview\n\n`ram-dl` is a tool that allows you to **upload** and **download** RAM to/from your system. Well, sort of :P\n\nIt is mostly intended as a tech demo for [r3map](https://github.com/pojntfx/r3map), a library for efficient distributed `mmap` with mounting and migration support, and [go-nbd](https://github.com/pojntfx/go-nbd), a pure Go NBD server and client library. Despite this it can however also be of use for a few experimental use cases, such as:\n\n- **Extending a system's memory capacity over the network**: By leveraging the fast [fRPC](https://frpc.io/) RPC framework, you can use `ram-dl` and `ram-ul` to expand your local system's RAM (effectively **\"downloading RAM\"**) without having to use local disk space or memory.\n- **Mounting a remote system's memory**: By allocating a memory region with `ram-ul` (effectively **\"uploading RAM\"**), it is possible to mount a remote system's RAM to your local system with minimal latency.\n- **Getting insights into memory usage and contents**: By inspecting the \"downloaded\"/mounted memory with `ram-ul`, you can get insights into the contents of a remote system's memory.\n\n`ram-dl` achieves this by essentially doing the following:\n\n1. Starting a `go-nbd` server _and_ client locally with r3map's [Direct Mount API](https://pkg.go.dev/github.com/pojntfx/r3map@main/pkg/mount)\n2. Connecting the NBD _server_ to a remote fRPC backend provided by `ram-ul`\n3. Calling `mkswap`, `swapon` and `swapoff`, which enables paging out to the block device provided by the NBD client and thus to the connected remote fRPC backend.\n\nFor most real-world use cases, using [r3map](https://github.com/pojntfx/r3map)'s [Managed Mount API](https://pkg.go.dev/github.com/pojntfx/r3map@main/pkg/mount) or [Migration API](https://pkg.go.dev/github.com/pojntfx/r3map@main/pkg/migration) directly is the better (and much faster) option, but if you just want to see the [Download More RAM](https://knowyourmeme.com/memes/download-more-ram) meme implemented in real life, you've come to the right place!\n\n## Installation\n\nStatic binaries are available on [GitHub releases](https://github.com/pojntfx/ram-dl/releases).\n\nOn Linux, you can install them like so:\n\n```shell\n$ curl -L -o /tmp/ram-dl \"https://github.com/pojntfx/ram-dl/releases/latest/download/ram-dl.linux-$(uname -m)\"\n$ curl -L -o /tmp/ram-ul \"https://github.com/pojntfx/ram-dl/releases/latest/download/ram-ul.linux-$(uname -m)\"\n$ sudo install /tmp/ram-dl /usr/local/bin\n$ sudo install /tmp/ram-ul /usr/local/bin\n```\n\nYou can find binaries for more architectures on [GitHub releases](https://github.com/pojntfx/ram-dl/releases).\n\n## Tutorial\n\n\u003e TL;DR: \"Upload\" RAM with `ram-ul`, \"download\" the RAM with `ram-dl`, done!\n\n### 1. Upload RAM\n\nOn a remote (or local) system, first start `ram-ul`. This component exposes a memory region, file or directory as a fRPC server:\n\n```shell\n$ ram-ul --size 4294967296\n2023/06/30 14:52:12 Listening on :1337\n```\n\n### 2. Download RAM\n\nOn your local system, start `ram-dl`. This will mount the remote system's exposed memory region, file or directory using fRPC and r3map as swap space, and umount it as soon as you interrupt the app:\n\n```shell\n$ sudo modprobe nbd\n$ sudo ram-dl --raddr localhost:1337\n2023/06/30 14:54:22 Connected to localhost:1337\n2023/06/30 14:54:22 Ready on /dev/nbd0\n```\n\nThis should give you an extra 4GB of local memory/swap space, without using up significant local memory (or disk space):\n\n```shell\n# Before\n$ free -h\n               total        used        free      shared  buff/cache   available\nMem:            30Gi       7.9Gi       6.5Gi       721Mi        16Gi        21Gi\nSwap:          8.0Gi          0B       8.0Gi\n\n# After\n$ free -h\n               total        used        free      shared  buff/cache   available\nMem:            30Gi       7.9Gi       6.5Gi       717Mi        16Gi        21Gi\nSwap:           11Gi          0B        11Gi\n```\n\n🚀 **That's it!** We hope you have fun using `ram-dl`, and if you're interested in more like this, be sure to check out [r3map](https://github.com/pojntfx/r3map)!\n\n## Reference\n\n### ram-dl\n\n```shell\n$ ram-dl --help\nUsage of ram-dl:\n  -chunk-size int\n    \tChunk size to use (default 4096)\n  -chunking\n    \tWhether the backend requires to be interfaced with in fixed chunks (default true)\n  -raddr string\n    \tRemote address for the fRPC r3map backend server (default \"localhost:1337\")\n  -size int\n    \tSize of the memory region or file to allocate (default 4294967296)\n  -verbose\n    \tWhether to enable verbose logging\n```\n\n### ram-ul\n\n```shell\n$ ram-ul --help\nUsage of ram-ul:\n  -addr string\n    \tListen address (default \":1337\")\n  -backend string\n    \tBackend to use (one of [file memory directory]) (default \"file\")\n  -chunk-size int\n    \tChunk size to use (default 4096)\n  -chunking\n    \tWhether the backend requires to be interfaced with in fixed chunks in tests (default true)\n  -location string\n    \tBackend's directory (for directory backend) or file (for file backend) (default \"/tmp/ram-ul\")\n  -size int\n    \tSize of the memory region or file to allocate (default 4294967296)\n  -verbose\n    \tWhether to enable verbose logging\n```\n\n## Acknowledgements\n\n- [pojntfx/go-bd](https://github.com/pojntfx/go-nbd) provides the Go NBD client and server.\n- [pojntfx/r3map](https://github.com/pojntfx/r3map) provides the device abstraction layer.\n- [\"We ACTUALLY downloaded more RAM\" by LTT](https://www.youtube.com/watch?v=minxwFqinpw) provided the original idea for this demo.\n\n## Contributing\n\nTo contribute, please use the [GitHub flow](https://guides.github.com/introduction/flow/) and follow our [Code of Conduct](./CODE_OF_CONDUCT.md).\n\nTo build and start a development version of `ram-dl` locally, run the following:\n\n```shell\n$ git clone https://github.com/pojntfx/ram-dl.git\n$ cd ram-dl\n$ make depend\n$ make \u0026\u0026 sudo make install\n$ sudo modprobe nbd\n$ ram-ul\n# In another terminal\n$ sudo ram-dl\n```\n\nHave any questions or need help? Chat with us [on Matrix](https://matrix.to/#/#ram-dl:matrix.org?via=matrix.org)!\n\n## License\n\nram-dl (c) 2024 Felicitas Pojtinger and contributors\n\nSPDX-License-Identifier: AGPL-3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpojntfx%2Fram-dl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpojntfx%2Fram-dl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpojntfx%2Fram-dl/lists"}